gpt4 book ai didi

linux - EC2 中的 apt 命令采用了错误的版本

转载 作者:行者123 更新时间:2023-12-04 19:04:55 24 4
gpt4 key购买 nike

我们正在尝试安装 libmysqlclient-dev并使用了这个命令:sudo apt-get install libmysqlclient-dev -y我们收到以下错误:

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
libmysqlclient21
The following NEW packages will be installed:
libmysqlclient-dev libmysqlclient21
0 upgraded, 2 newly installed, 0 to remove and 12 not upgraded.
Need to get 2,892 kB of archives.
After this operation, 17.8 MB of additional disk space will be used.
Ign:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libmysqlclient21 amd64 8.0.28-0ubuntu0.20.04.3
Err:1 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libmysqlclient21 amd64 8.0.28-0ubuntu0.20.04.3
404 Not Found [IP: 185.125.190.36 80]
Ign:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libmysqlclient-dev amd64 8.0.28-0ubuntu0.20.04.3
Err:2 http://security.ubuntu.com/ubuntu focal-updates/main amd64 libmysqlclient-dev amd64 8.0.28-0ubuntu0.20.04.3
404 Not Found [IP: 185.125.190.36 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-8.0/libmysqlclient21_8.0.28-0ubuntu0.20.04.3_amd64.deb 404 Not Found [IP: 185.125.190.36 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/m/mysql-8.0/libmysqlclient-dev_8.0.28-0ubuntu0.20.04.3_amd64.deb 404 Not Found [IP: 185.125.190.36 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
我们都使用了 apt-get update--fix-missing选项。我们得到了同样的错误。
然后我们使用 sudo apt-cache policy libmysqlclient-dev 列出了可用的版本。 :
我们有:
libmysqlclient-dev:
Installed: (none)
Candidate: 8.0.28-0ubuntu0.20.04.3
Version table:
8.0.28-0ubuntu0.20.04.3 500
500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages
8.0.19-0ubuntu5 500
500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages
我们去了 http://security.ubuntu.com/ubuntu/pool/main/m/mysql-8.0/ :
Screen shot of the available packages
我们使用 lsb_release -a 获得了 linux 的版本。 :
Distributor ID: Ubuntu
Description: Ubuntu 20.04.4 LTS
Release: 20.04
Codename: focal
然后我们尝试使用 sudo apt-get install libmysqlclient-dev=8.0.28-0ubuntu0.20.04.4 -y 强制安装可用版本。 :
我们有 :
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Version '8.0.28-0ubuntu0.20.04.4' for 'libmysqlclient-dev' was not found
我们如何安装这个包?

最佳答案

尝试:
1] 编辑您的/etc/apt/sources.list
2]评论或删除所有内容
3]粘贴这个

deb http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse
#
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse
#
deb http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
#
deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse
#
deb http://archive.canonical.com/ubuntu focal partner
deb-src http://archive.canonical.com/ubuntu focal partner
  • apt clean all && apt update

  • 它们是focal的官方包。
    我希望它有效!

    关于linux - EC2 中的 apt 命令采用了错误的版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72297351/

    24 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com