Created
June 22, 2025 01:46
-
-
Save rotexdegba/e93ef568aa1af7e06a9129158ade2350 to your computer and use it in GitHub Desktop.
Update Cent OS 7 Repos To the Vault Ones POST CENT OS 7 EOL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
cd /etc/yum.repos.d | |
sudo mkdir original_repos | |
sudo cp -v *.repo original_repos | |
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 sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-* | |
sudo sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-* | |
sudo yum clean all | |
sudo yum update | |
cd ~ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment