CentOS yum 换为阿里云,163源

阿里云镜像网址
http://mirrors.aliyun.com/

更新步骤

一、备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

二、下载新的CentOS-Base.repo 到/etc/yum.repos.d/

阿里云yum源
  • CentOS 5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
  • CentOS 6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
  • CentOS 7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
163yum源
  • Centos5:
wget -P /etc/yum.repos.d http://mirrors.163.com/.help/CentOS5-Base-163.repo
  • Centos6:
wget -P /etc/yum.repos.d http://mirrors.163.com/.help/CentOS6-Base-163.repo
  • Centos7:
wget -P /etc/yum.repos.d http://mirrors.163.com/.help/CentOS7-Base-163.repo

三、之后运行yum makecache生成缓存

yum clean all
yum makecache
posted @ 2018-12-05 10:46  vlees  阅读(6)  评论(0)    收藏  举报