Updating CentOS Repo Files After Mirrorlist End of Life
What
CentOS Linux 7 reached end of life on June 30, 2024. The normal mirror list no longer provides packages for this release; its final packages are archived at vault.centos.org.
When/Why
Use this procedure only when a legacy CentOS Linux 7 appliance must temporarily regain access to archived packages. The vault is frozen and receives no new security or bug-fix updates.
For a FileWave Server, Booster, or IVS, moving to the supported Debian platform is the durable fix. Review FileWave Server on CentOS - EOL before using this short-term repository workaround.
How
Open a stable SSH or console session. The first commands create a timestamped copy of the complete repository directory; keep the printed backup path for rollback.
repo_backup="/etc/yum.repos.d.before-centos-vault-$(date +%Y%m%d-%H%M%S)"
sudo cp -a /etc/yum.repos.d "$repo_backup"
printf 'Repository backup: %s\n' "$repo_backup"
sudo sed -i 's|mirror.centos.org|vault.centos.org|g' /etc/yum.repos.d/*.repo
sudo sed -i 's|^#.*baseurl=http|baseurl=http|g' /etc/yum.repos.d/*.repo
sudo sed -i 's|^mirrorlist=http|#mirrorlist=http|g' /etc/yum.repos.d/*.repo
sudo yum clean all
sudo yum makecache
sudo yum repolist
What the commands do:
- Replace all instances of mirror.centos.org with vault.centos.org in the .repo files.
- Uncomment (sed -i s/^#.*baseurl=http/baseurl=http/g) the baseurl lines in the .repo files.
- Comment out (sed -i s/^mirrorlist=http/#mirrorlist=http/g) the mirrorlist lines in the .repo files.
The final two commands rebuild repository metadata and list the enabled repositories. If either command fails, restore the backup before making more changes. A successful cache rebuild confirms access to the archive; it does not make CentOS Linux 7 supported or current.
Rollback
Replace the example backup path below with the exact path printed earlier. This keeps the attempted vault configuration under a separate name while restoring the original repository directory.
repo_backup="/etc/yum.repos.d.before-centos-vault-YYYYMMDD-HHMMSS"
sudo mv /etc/yum.repos.d /etc/yum.repos.d.vault-attempt
sudo cp -a "$repo_backup" /etc/yum.repos.d
sudo yum clean all
sudo yum makecache
No comments to display
No comments to display