运行 apt-get update 和 apt-get install mysql-server 时出错

Car*_*los 12 aptitude apt amazon-ec2

从昨天开始我一直在努力奔跑

apt-get update
Run Code Online (Sandbox Code Playgroud)

在我在 EC2 上创建的 Ubuntu 实例中失败。

具体来说,我一直在收到这些错误:

Ign http://security.ubuntu.com maverick-security/main amd64 Packages
Ign http://security.ubuntu.com maverick-security/universe amd64 Packages
Ign http://security.ubuntu.com maverick-security/multiverse amd64 Packages
Err http://security.ubuntu.com maverick-security/main Sources
  404  Not Found [IP: 91.189.92.190 80]
Err http://security.ubuntu.com maverick-security/universe Sources
  404  Not Found [IP: 91.189.92.190 80]
Err http://security.ubuntu.com maverick-security/main amd64 Packages
  404  Not Found [IP: 91.189.92.190 80]
Err http://security.ubuntu.com maverick-security/universe amd64 Packages
  404  Not Found [IP: 91.189.92.190 80]
Err http://security.ubuntu.com maverick-security/multiverse amd64 Packages
  404  Not Found [IP: 91.189.92.190 80]
W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/maverick-security/main/source/Sources.gz  404  Not Found [IP: 91.189.92.190 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/maverick-security/universe/source/Sources.gz  404  Not Found [IP: 91.189.92.190 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/maverick-security/main/binary-amd64/Packages.gz  404  Not Found [IP: 91.189.92.190 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/maverick-security/universe/binary-amd64/Packages.gz  404  Not Found [IP: 91.189.92.190 80]

W: Failed to fetch http://security.ubuntu.com/ubuntu/dists/maverick-security/multiverse/binary-amd64/Packages.gz  404  Not Found [IP: 91.189.92.190 80]

E: Some index files failed to download, they have been ignored, or old ones used instead.
root@ip-10-168-230-63:/etc/apt# 
Run Code Online (Sandbox Code Playgroud)

也在尝试安装 mysql-server 时,我遇到了错误:

root@ip-10-168-230-63:/etc/apt# apt-get install mysql-server
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  libhtml-template-perl mysql-server-5.1 mysql-server-core-5.1
Suggested packages:
  libipc-sharedcache-perl tinyca mailx
The following NEW packages will be installed:
  libhtml-template-perl mysql-server mysql-server-5.1 mysql-server-core-5.1
0 upgraded, 4 newly installed, 0 to remove and 81 not upgraded.
Need to get 12.1MB/12.2MB of archives.
After this operation, 29.5MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Err http://us-west-1.ec2.archive.ubuntu.com/ubuntu/ maverick-updates/main mysql-server-core-5.1 amd64 5.1.61-0ubuntu0.10.10.1
  403  Forbidden
Err http://us-west-1.ec2.archive.ubuntu.com/ubuntu/ maverick-updates/main mysql-server-5.1 amd64 5.1.61-0ubuntu0.10.10.1
  403  Forbidden
Err http://us-west-1.ec2.archive.ubuntu.com/ubuntu/ maverick-updates/main mysql-server all 5.1.61-0ubuntu0.10.10.1
  403  Forbidden
Failed to fetch http://us-west-1.ec2.archive.ubuntu.com/ubuntu/pool/main/m/mysql-5.1/mysql-server-core-5.1_5.1.61-0ubuntu0.10.10.1_amd64.deb  403  Forbidden
Failed to fetch http://us-west-1.ec2.archive.ubuntu.com/ubuntu/pool/main/m/mysql-5.1/mysql-server-5.1_5.1.61-0ubuntu0.10.10.1_amd64.deb  403  Forbidden
Failed to fetch http://us-west-1.ec2.archive.ubuntu.com/ubuntu/pool/main/m/mysql-5.1/mysql-server_5.1.61-0ubuntu0.10.10.1_all.deb  403  Forbidden
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
root@ip-10-168-230-63:/etc/apt# 
Run Code Online (Sandbox Code Playgroud)

我确实跑了

apt-get update --fix-missing
Run Code Online (Sandbox Code Playgroud)

没有任何运气。

有任何想法吗?

我已经在 AWS EC2 中运行的 Ubuntu Linux 实例上多次完成这些任务,没有任何问题。在此先感谢您的帮助!

小智 14

这是Amazon S3 的一个已知错误。要解决这个问题,只需运行sudo apt-get update

  • 他在运行“apt-get update”时遇到问题,所以您推荐的解决方案是运行“apt-get update”?! (3认同)

kyn*_*nan 7

Ubuntu 10.10 Maverick Meerkat 已于 2012 年 4 月 10 日停产 (EOL),这意味着没有进一步的更新(甚至没有安全修复),并且软件包存档从archive.ubuntu.com移至old-releases.ubuntu.com,这就是您看到的错误的原因.

编辑/etc/apt/sources.list修复您的包源。请注意,您还需要删除us-west-1.ec2前缀:EOL 版本没有专用的 EC2 软件包服务器。


Car*_*los 6

解决方法是将这些行添加到 sources.list:

deb http://us.archive.ubuntu.com/ubuntu lucid main multiverse universe
deb http://us.archive.ubuntu.com/ubuntu lucid-security main multiverse universe
deb http://us.archive.ubuntu.com/ubuntu lucid-updates main multiverse universe
Run Code Online (Sandbox Code Playgroud)

感谢您的回复。

  • 小心:这也将有一天停止工作。您已经 - 不会 - 通过 archive.ubuntu.com 接收安全更新。如果您想保持 LTS,我建议升级或重新安装 12.04。 (2认同)