centos yum 问题

centos yum 问题

我是 Linux 新手,刚刚格式化我的 centos 5.2 vps,并尝试使用命令 yum install links 安装 links。但显示以下错误:

[root@inverses ~]# yum install links
Loading "fastestmirror" plugin
Loading mirror speeds from cached hostfile
 * lxlabsupdate: download.lxlabs.com
 * lxlabslxupdate: download.lxlabs.com
 * base: ftp.nluug.nl
 * updates: distrib-coffee.ipsl.jussieu.fr
 * addons: mirror.answerstolove.com
 * extras: distrib-coffee.ipsl.jussieu.fr
http://ftp.nluug.nl/ftp/pub/os/Linux/distr/CentOS/5.2/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://distrib-coffee.ipsl.jussieu.fr/pub/linux/centos/5.2/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirror.ukhost4u.com/centos/5.2/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://centosh2.centos.org/centos/5.2/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://mirror.atrpms.net/centos/5.2/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://centosf.centos.org/centos/5.2/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://centoso3.centos.org/centos/5.2/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://centosk.centos.org/centos/5.2/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://centosv.centos.org/centos/5.2/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
http://centosk3.centos.org/centos/5.2/os/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404: Not Found
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

我检查了一些 URL 是否存在,从中得知,它们需要从 .../5.2/.. 重定向到 ../5/。这是需要更改的常见内容吗?我该如何改变呢?

这是我的 CentOS-Base.repohttp://pastebin.com/m67c1a022

答案1

5.3 是当前版本,建议您升级到该版本。

http://centosk3.centos.org/centos/5.2/readme

This directory (and version of CentOS) is depreciated.  For normal users,
you should use /5/ and not /5.2/ in your path. Please see this FAQ
concerning the CentOS release scheme:

http://www.centos.org/modules/smartfaq/faq.php?faqid=34

If you know what you are doing, and absolutely want to remain at the 5.2
level, go to http://vault.centos.org/ for packages.

您可以在 /etc/yum.repos.d/ 中修改 repo 位置

据我所知,/5/ 应该是最新 5.x 版本的链接


编辑:刚刚看到您发布的 repo 文件。

[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=5.2&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

我身边没有 centos 机器可以检查(不再使用它),但我相信那里的镜像列表行已经被修改,它应该包含一个版本变量,而不是一个实际的数字,就像在注释的 baseurl 选项中一样。

将镜像列表中的 5.2 替换为:

mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates

完成此操作后,您应该能够yum upgrade升级到下一个版本。这是系统默认应该执行的操作。

答案2

对我来说这是一个缓存问题......

yum clean all

yum update

之后它就可以工作了。

答案3

您可以使用以下链接进行升级,但我觉得您的文件有问题/etc/yum.repos.d/####.repo。您可以替换该文件并再试一次。

http://www.cyberciti.biz/tips/red-hat-enterprise-linux-5-4-released.html这是针对 RHEL 5.4 的,但与 centos 是一样的。

答案4

你能用 wget 吗http://serverfault.com (在我看来,这似乎是 DNS 问题)检查您的 /etc/resolv.conf 文件,确保它指向您的 DNS 服务器、主网关或 OpenDNS IP 之类的东西。如果您可以访问网络外的站点,那么... 尝试以下命令:yum clean all

令人厌烦的问题...

相关内容