Created
August 10, 2024 04:32
-
-
Save NotYusta/72bdb4a715a93ad02c826fd0e6754713 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# Backup the original repository files | |
echo "Backing up original repo files..." | |
sudo cp -r /etc/yum.repos.d /etc/yum.repos.d.backup | |
# Update the repository configuration | |
echo "Updating repository configuration..." | |
sudo sed -i 's|mirrorlist=|#mirrorlist=|g' /etc/yum.repos.d/*.repo | |
sudo sed -i 's|#baseurl=http://dl.rockylinux.org/$contentdir/$releasever|baseurl=https://rocky-linux-asia-southeast1.production.gcp.mirrors.ctrliq.cloud/pub/rocky/$releasever|g' /etc/yum.repos.d/*.repo | |
# Clean the yum cache | |
echo "Cleaning yum cache..." | |
sudo yum clean all | |
# Update the system | |
echo "Updating the system..." | |
sudo yum update -y | |
echo "Repository mirror update complete!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment