首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >EC2中apt命令中的错误版本

EC2中apt命令中的错误版本
EN

Stack Overflow用户
提问于 2022-05-19 00:27:22
回答 1查看 86关注 0票数 0

我们正在尝试安装libmysqlclient-dev并使用以下命令:

sudo apt-get install libmysqlclient-dev -y

我们得到了以下错误:

代码语言:javascript
复制
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列出可用的版本。

我们有:

代码语言:javascript
复制
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/

我们使用lsb_release -a获得linux的版本。

代码语言:javascript
复制
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强制安装可用的版本。

我们有:

代码语言:javascript
复制
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

如何安装这个包?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-05-19 01:57:47

尝试:

1]编辑你的/etc/apt/sources.list .列表

2]注释或删除所有内容

3]粘贴这个

代码语言:javascript
复制
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

  1. apt清理一切&& apt更新

它们是正式的焦点包。我希望它能成功!

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72297351

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档