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...
沒必要慌張,輸入如下命令便可shell

rm -f /var/run/yum.pid
相關文章
相關標籤/搜索