Differences

This shows you the differences between two versions of the page.

Link to this comparison view

centos5:cannot-find-a-valid-baseurl-error-fix [2017-09-14 13:42:38] (current)
rory.blanchard created
Line 1: Line 1:
 +====== CentOS 5 "​cannot find a valid baseurl for repo" Error Fix ======
  
 +When trying to update or install packages on older CentOS 5 systems, you may run into the following error.
 +
 +<​code>​
 +root@server1 [~]# yum update -y
 +Loaded plugins: fastestmirror
 +Determining fastest mirrors
 +YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
 + Eg. Invalid release/
 +removing mirrorlist with no valid mirrors: /​var/​cache/​yum/​base/​mirrorlist.txt
 +Error: Cannot find a valid baseurl for repo: base
 +</​code>​
 +
 +This is commonly caused by attempting to use deprecated repositories. The update repositories were moved to the CentOS vault when the operating reached it's end-of-life.
 +
 +In order to continue using the operating system packages, you will need to update your repository entries to point to the vault.
 +
 +Using your favorite text editor, open **/​etc/​yum.repos.d/​CentOS-Base.repo**
 +
 +Look for the following:
 +
 +<​code>​
 +[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
 +</​code>​
 +
 +Comment out the mirror list, and uncomment the baseurl. So it should look like the following:
 +
 +<​code>​
 +#​mirrorlist=
 +baseurl=
 +</​code>​
 +
 +Next, you will need to put in the URL for the vault repository.
 +
 +for 32-bit systems, use:
 +http://​vault.centos.org/​5.11/​os/​i386/​
 +
 +for 64-bit systems, use:
 +http://​vault.centos.org/​5.11/​os/​x86_64/​
 +
 +<​note>​For each repository, you will need to replace /os/ with what repository subdirectory you need. For example on a 64-bit system, for updates, your URL will look like **http://​vault.centos.org/​5.11/​updates/​x86_64/​** and for extras it will look like **http://​vault.centos.org/​5.11/​extras/​x86_64/​** Always check the old url first to make sure you have right path. You can also check **http://​vault.centos.org** to see all available repositories.
 +</​note>​
 +
 +Once you have added this, run the following to clean your yum cache:
 +
 +<​code>​
 +yum clean all
 +</​code>​
 +
 +Then update yum to start using the new repositories:​
 +
 +<​code>​
 +yum update
 +</​code>​
 +
 +\\
 +\\