How to Fix YUM on CentOS 6 "Error: Cannot retrieve repository metadata" ?

Throughout this guide, you'll see how to fix the following error while running either yum update or yum upgrade:

Setting up Upgrade Process
YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Eg. Invalid release/repo/arch combination/
removing mirrorlist with no valid mirrors: /var/cache/yum/x86_64/6/base/mirrorlist.txt
Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again

This error occurred since CentOS 6 was declared End Of Life as per the CentOS lifecycle schedule on November 2020. 

In order to fix the error on your VPS, you may run the following command on your VPS: 

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak && wget -O /etc/yum.repos.d/CentOS-Base.repo https://www.host-stage.net/hsmirrors/centos6repofix && yum clean all

The command will replace the old CentOS repository to the vault CentOS repository and reinstate the yum update possibility. 

 

 

  • yum, yum update, yum upgrade, centos6
  • 200 Users Found This Useful
Was this answer helpful?

Related Articles

How to Refresh your cPanel License

If you have purchased your linux VPS along with a cPanel license. Your license won't be active...

How To Clean your cPanel Logs Files in One Go

This tutorial is meant to provide a shortcut to clean your log files in a cPanel Dedicated Server...

How To Update cPanel From SSH or GUI

In order to update the cPanel software on a Linux VPS, there is 2 ways to do it. Upgrading the...

How To Backup / Restore / Export your CSF Firewall Configuration

Whenever you want to deploy a new Linux VPS / Dedicated server, you generally have to set and...

How to Install the CSF / LFD Firewall on your VPS / Dedicated Server

Throughout this guide, you'll learn how to install your own Firewall on your linux VPS /...