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

标签 linux ubuntu amazon-ec2 apt apt-get

我们正在尝试安装 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/

    相关文章:

    python - 在 AWS Elastic Beanstalk 上部署 Python

    linux - 为什么系统调用会破坏 rcx 和 r11?

    linux - 注销后 GNU Screen 找不到应用程序

    c++ - 即使使用 lpthread 也有 undefined reference to `pthread_join' 错误

    java - 使用 java 8 进行 Spark 提交

    amazon-web-services - 无权执行 : aws-marketplace:ViewSubscriptions on resource: *

    c - 我无法使打开/读取/关闭低级功能在 Ubuntu 中工作

    linux - 提供一个脚本从另一个脚本的选项输入

    c# - 如何在 Debian 上成功安装完整的 Mono Develop IDE?

    ubuntu webkit 安装