【转载】CentOS更新yum源
2016-10-12 11:00
253 查看
首先备份/etc/yum.repos.d/CentOS-Base.repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)
163源
CentOS5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo
CentOS6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
CentOS7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
aliyun源
CentOS5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
运行以下命令生成缓存
yum clean all
yum makecache
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)
163源
CentOS5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo
CentOS6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
CentOS7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
aliyun源
CentOS5
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo
CentOS6
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo
CentOS7
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
运行以下命令生成缓存
yum clean all
yum makecache
相关文章推荐
- 【转载】centos6.x/6.2/6.3 更新yum源
- centos6.2更新yum源
- Centos6.5通过创建局域网http实现yum源的更新
- CentOS更新yum源
- CentOS更改yum源与更新系统
- CentOS更改yum源与更新系统
- [原]CentOS 6.2(32位)如何使用YUM源更新的方法
- Centos6.6 yum源更新
- CentOS更改yum源与更新系统
- CentOS更改yum源与更新系统
- CentOS更改yum源与更新系统
- CentOS6.5 更新yum源
- CentOS更改yum源与更新系统
- centos6.2更新yum源
- Red Hat 6.2 64如何使用Centos的YUM源更新两种方法
- Centos更新yum源
- centos-6更新yum源(163)
- 在CentOS 7下更改yum源与更新系统。
- CentOS通过YUM源更新SSH
- centos6.5 更新yum源