How to fix CentOS Yum Error – 4 is not a valid release

How to fix CentOS Yum Error – 4 is not a valid release

centos 300x114 1 • Freelance WordPress Developer and Speed Optimisation London • Dipak C. Gajjar

After CentOS 4 hit End of Life in February (No updates after 29 February 2012), you may have noticed the following error coming from the “yum” installer:
not using FTP, http[s], or file for repos, skipping – 4 is not a valid release or hasn't been released yet

However, there is a very easy way to get “yum” working again without upgrading everything to a newer version of CentOS.

  1. Login to your server/SSH using root
  2. Open /etc/yum.repos.d/CentOS-Base.repo in an editor (vi/vim)
  3. Comment out the “mirrorlist” entries
  4. Uncomment the “baseurl” entries and change them to http://vault.centos.org/4.9/os/$basearch

That's it!