CentOS7 更新yum源

对CentOS-Base.repo进行备份

cd /etc/yum.repos.d
cp CentOS-Base.repo CentOS-Base.repo.bak

使用阿里云源替换本地源

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

清除yum缓存并更新

yum makecache
yum -y update

tips

如果在yum makecache的过程中一直报:
Another app is currently holding the yum lock; waiting for it to exit...
不必慌张,输入以下命令即可

rm -f /var/run/yum.pid

你可能感兴趣的:(linux,centos,yum,阿里源)