1. 程式人生 > >centos7更新yum庫為aliyun庫

centos7更新yum庫為aliyun庫

1. 備份原來的yum源
$sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
2.設定aliyun的yum源
$sudo wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
3.新增EPEL源
$sudo wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo

4.清理快取,生成新快取,執行yum更新
$sudo yum clean all

$sudo yum makecache
$sudo yum update

感謝阿里為國內開發者做的貢獻

摘自 https://blog.csdn.net/zytbft/article/details/8116