Skip to content

Yum

CentOS 切换 yum 源

备份 yum 源

shell
cd /etc/yum.repos.d/
ls -lh
rename '.repo' '.repo.bak' CentOS*.repo
ls -lh

切换阿里 yum 源

shell
sudo curl -o /etc/yum.repos.d/Centos-7.repo https://mirrors.aliyun.com/repo/Centos-7.repo
sudo yum clean all
sudo yum makecache
shell
sudo curl -o /etc/yum.repos.d/Centos-8.repo https://mirrors.aliyun.com/repo/Centos-8.repo
sudo yum clean all
sudo yum makecache
shell
sudo curl -o /etc/yum.repos.d/Centos-vault-8.5.2111.repo https://mirrors.aliyun.com/repo/Centos-vault-8.5.2111.repo
sudo yum clean all
sudo yum makecache
shell
sudo curl -o /etc/yum.repos.d/epel-7.repo https://mirrors.aliyun.com/repo/epel-7.repo
sudo yum clean all
sudo yum makecache