CentOS 修改yum源为国内源(阿里)

前端之家收集整理的这篇文章主要介绍了CentOS 修改yum源为国内源(阿里)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

如下Centos 6.8修改到阿里云:
阿里云Linux安装镜像源:
1.备份原镜像文件以便于恢复。
[root@localhost ~]#mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
2.下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5

[root@localhost ~]#wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-5.repo

CentOS 6

[root@localhost ~]#wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

3.运行yum makecache生成缓存

[root@localhost ~]#yum makecache

163安装软件镜像源:
1.备份你的原镜像文件,以免出错后可以恢复。

[root@localhost ~]#mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2.下载新的CentOS-Base.repo 到/etc/yum.repos.d/
CentOS 5

[root@localhost ~]#wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo

CentOS 6

[root@localhost ~]#wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo

3.运行以下命令生成缓存

[root@localhost ~]#yum clean all
[root@localhost ~]#yum makecache
http://mirrors.163.com/.help/centos.html

猜你在找的CentOS相关文章