centos 配置 aliyun yum源

备份

cd /etc/yum.repos.d
mv ./CentOS-Base.repo ./CentOS-Base.repo.bak
mv ./CentOS-Debuginfo.repo ./CentOS-Debuginfo.repo.bak
mv ./CentOS-fasttrack.repo ./CentOS-fasttrack.repo.bak
mv ./CentOS-Media.repo ./CentOS-Media.repo.bak
mv ./CentOS-Vault.repo ./CentOS-Vault.repo.bak

CentOS-Base.repo

CentOS 7

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

CentOS 6

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

CentOS 5

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

运行yum makecache生成缓存

yum makecache 

你可能感兴趣的:(#,linux,rhel,centos)