Today I need to test something with CentOS5.5, but I find the following error occurred while running the Yum command
Loaded Plugins:allowdowngrade, downloadonly fastestmirror determining fastest mirrors Error:cannot find
A Valid baseurl for repo:addons
yumrepo error:all Mirror URL are not using FTP, Http[s] or file.
Eg. Invalid release/
Removing mirrorlist with no valid mirrors:/var/cache/yum/addons/mirrorlist.txt the
command '/ bin/sh-c rpm--rebuilddb && yum install-y sudo tar openssh-server supervisor keepalived ' returned a non-zero cod E:1
The reason for this problem CentOS5 version is too old, the official is no longer maintained, so the URL in the Yum default profile can no longer be used.
Therefore, you need to modify the URL in the/etc/yum.repos.d/centos-base.repo file
Here is the configuration before the modification
# Centos-base.repo # The Mirror system uses the connecting IP address of the client and the ' # Update status of each MIRR or to pick mirrors which are updated to and # geographically close to the client.
You are should use this for CentOS updates # unless to are manually other picking.
# # If The mirrorlist= does not work for your, as a fall back you can try the # remarked out Baseurl= line instead. # [Base] name=centos-$releasever-base mirrorlist=http://mirrorlist.centos.org/?release= $releasever &arch=$ Basearch&repo=os #baseurl =http://mirror.centos.org/centos/$releasever/os/$basearch/gpgcheck=1 gpgkey=file:// /etc/pki/rpm-gpg/rpm-gpg-key-centos-5 #released Updates [updates] name=centos-$releasever-updates mirrorlist=http:/ /mirrorlist.centos.org/?release= $releasever &arch= $basearch &repo=updates #baseurl =http:// mirror.centos.org/centos/$releasever/updates/$basearch/gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/ Rpm-gpg-key-centos-5 #packages used/produced in the BUild but not released [addons] name=centos-$releasever-addons mirrorlist=http://mirrorlist.centos.org/?release=$ Releasever&arch= $basearch &repo=addons #baseurl =http://mirror.centos.org/centos/$releasever/addons/$ Basearch/gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-5 #additional packages that could be useful [ Extras] name=centos-$releasever-extras mirrorlist=http://mirrorlist.centos.org/?release= $releasever &arch=$ Basearch&repo=extras #baseurl =http://mirror.centos.org/centos/$releasever/extras/$basearch/gpgcheck=1 Gpgkey =file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-5 #additional packages that extend functionality of existing packages [ Centosplus] name=centos-$releasever-plus mirrorlist=http://mirrorlist.centos.org/?release= $releasever &arch=$ Basearch&repo=centosplus #baseurl =http://mirror.centos.org/centos/$releasever/centosplus/$basearch/gpgcheck =1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-5 #contrib-packages by CentOS Users [contrib] name=centos-$releasever-contrib mirrorlist=http://mirrorlist.centos.org/?release= $releasever & Arch= $basearch &repo=contrib #baseurl =http://mirror.centos.org/centos/$releasever/contrib/$basearch/gpgcheck
=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-5
The following is a modified configuration
# Centos-base.repo # The Mirror system uses the connecting IP address of the client and the ' # Update status of each MIRR or to pick mirrors which are updated to and # geographically close to the client.
You are should use this for CentOS updates # unless to are manually other picking.
# # If The mirrorlist= does not work for your, as a fall back you can try the # remarked out Baseurl= line instead. # [Base] name=centos-5.9-base #mirrorlist =http://mirrorlist.centos.org/?release=5.9&arch= $basearch &repo= Os baseurl=http://vault.centos.org/5.9/os/$basearch/gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/ rpm-gpg-key-centos-5 #released Updates [updates] name=centos-5.9-updates #mirrorlist =http://mirrorlist.centos.org/? Release=5.9&arch= $basearch &repo=updates baseurl=http://vault.centos.org/5.9/updates/$basearch/gpgcheck= 1 gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-5 #packages used/produced in the build but not released [addons] Name =centos-5.9-addons #mirrorlIst=http://mirrorlist.centos.org/?release=5.9&arch= $basearch &repo=addons baseurl=http:// vault.centos.org/5.9/addons/$basearch/gpgcheck=1 gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-5 #additional Packages so may useful [extras] Name=centos-5.9-extras #mirrorlist =http://mirrorlist.centos.org/?release=5.9 &arch= $basearch &repo=extras baseurl=http://vault.centos.org/5.9/extras/$basearch/gpgcheck=1 gpgkey=file :///etc/pki/rpm-gpg/rpm-gpg-key-centos-5 #additional packages that extend functionality of existing packages [ Centosplus] Name=centos-5.9-plus #mirrorlist =http://mirrorlist.centos.org/?release=5.9&arch= $basearch & Repo=centosplus baseurl=http://vault.centos.org/5.9/centosplus/$basearch/gpgcheck=1 enabled=0 gpgkey=file:///etc/ Pki/rpm-gpg/rpm-gpg-key-centos-5 #contrib-packages by CentOS Users [contrib] name=centos-5.9-contrib #mirrorlist =http ://mirrorlist.centos.org/?release=5.9&arch= $basearch &repo=contrib BASEURL=HTTP://VAULT.CENTOS.Org/5.9/contrib/$basearch/gpgcheck=1 enabled=0 gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-5
After the modification, reuse the Yum to install the package, and everything will work properly.