Article ID: 113473, created on Mar 30, 2012, last review on Aug 12, 2014

  • Applies to:
  • Plesk for Linux/Unix
  • Virtuozzo containers for Linux

问题症状

当使用 YUM:

尝试在物理服务器上的PVC Container中(直接登录到Container上)更新 CentOS 4 软件包时会得到这样的报错:
 
# yum update plesk9
Setting up Update Process
Setting up repositories
http://mirrors.stuhome.net/centos/4.9/updates/x86_64/repodata/repomd.xml: [Errno 4] IOError: <urlopen error (111, 'Connection refused')>
Trying other mirror.

Trying other mirror.
Cannot open/read repomd.xml file for repository: update
failure: repodata/repomd.xml from update: [Errno 256] No more mirrors to try.
Error: failure: repodata/repomd.xml from update: [Errno 256] No more mirrors to try.

 

当使用 "vzpkg" (仅针对 PVC containers):
 
尝试为PVC Container安装/升级基于 CentOS 4 的应用程序模板时会得到如下的报错:

# vzpkg install 101 plesk9
...
Installing applications: plesk9 plesk9-postfix mod_ssl mod_perl
http://mirror.centos.org/centos-4/4/centosplus/x86_64/repodata/repomd.xml: [Errno 4] IOError: HTTP Error 404: Not Found
Trying other mirror.
Cannot open/read repomd.xml file for repository: plesk9-centosplus1
failure: repodata/repomd.xml from plesk9-centosplus1: [Errno 256] No more mirrors to try.
Error: failure: repodata/repomd.xml from plesk9-centosplus1: [Errno 256] No more mirrors to try.
Error: /usr/share/vzyum/bin/yum failed, exitcode=1
Error: Can not update metadata for plesk9-centosplus. Skipped.


或者是这个:

# vzpkg install 101 plesk9
...
Cannot find a valid baseurl for: http://mirrorlist.centos.org/?release=4&arch=i386&repo=os
Error: Cannot find a valid baseurl for: http://mirrorlist.centos.org/?release=4&arch=i386&repo=os

问题原因

这个问题产生的原因是 CentOS 4 操作系统已经终止生命周期 (End-Of-Lifed) 并且不再通过原有的镜像服务器提供下载服务.
你可以在 CentOS 的主页上发现如下这个 EOL 通告

CentOS 4 EOL Announcement

The 7-year enterprise lifetime of CentOS-4 ends now. CentOS-4 has been copied to the CentOS Vault. The last released tree is available here.

All architectures of CentOS-4 (i386, x86_64, ppc, s390, and s390x) are
impacted. Support for the CentOS-4 Cluster Server and the CentOS-4
Global File Server (csgfs) is also ended.

The CentOS-4.8 and 4.9 trees will be emptied from the CentOS mirrors in
short order.

CentOS-4 will remain available in the CentOS Vault, along with CentOS-2
and CentOS-3, indefinitely. You can use the vault in the same way you
have used the CentOS mirrors in the past, however no updates will be
released for CentOS-4 moving forward.

Accordingly, the CentOS Project strongly recommends that you migrate any
CentOS-4 installs to a newer version of CentOS (either CentOS-5 or
CentOS-6).

Read the complete EOL announcement.


解决办法

针对物理服务器:

添加如下的镜像站点到你的 YUM 配置文件中:

http://vault.centos.org/

It is to be done by the server administrator, however you may try doing it yourself by running the below commands which get rid of the old repository configuration and put the new repository configuration file for CentOS 4.9 version to the yum repositories configuration folder:

# mv /etc/yum.repos.d/CentOS-Base.repo /tmp
# yum clean all
# wget -P /etc/yum.repos.d/ http://kb.sp.parallels.com/Attachments/19328/Attachments/CentOSVault.repo

Now commands like "yum install" and "yum update" should work on your server.

Note 1: You may need to remove other *.repo files from /etc/yum.repos.d folder in case you have additional repositories set up and they prevent yum from using the new repository.

Note 2: If the above commands do not fix the issue for you, address the problem to your server administrator as it is a pure server administration task.
 

For a PVC container:

1. Edit this file (example is for CentOS 4.9 version):

/vz/template/centos/4/x86_64/config/os/default/repositories
 
Instead of default repositories, specify direct links to the vault.centos.org along with EZ templates repositories:

# cat /vz/template/centos/4/x86_64/config/os/default/repositories
#$CE_SERVER/centos/4/os/x86_64
#$CE_SERVER/centos/4/updates/x86_64
http://vault.centos.org/4.9/os/x86_64
http://vault.centos.org/4.9/updates/x86_64

http://vzdownload.swsoft.com/ez/packages/centos/4/i386/os/
http://vzdownload.swsoft.com/ez/packages/centos/4/i386/updates/

2. Remove or rename mirrorlist file:
# cd /vz/template/centos/4/x86_64/config/os/default
# mv mirrorlist mirrorlist.old

3. Clean metadata for the OS template:
# vzpkg clean centos-4-x86_64 -a

4. Update metadata of the OS template using command:
# vzpkg update metadata centos-4-x86_64 –r

5. Repeat steps 1-4 for the x86 architecture if needed.

Attachments

29d1e90fd304f01e6420fbe60f66f838 a914db3fdc7a53ddcfd1b2db8f5a1b9c e8e50b42231236b82df27684e7ec0beb d02f9caf3e11b191a38179103495106f 2897d76d56d2010f4e3a28f864d69223 56797cefb1efc9130f7c48a7d1db0f0c

Email subscription for changes to this article