修改Centos7的yum源

以下为修改Centos7的yum源:

1. 备份原镜像文件,便于后期恢复

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

 

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

 

Centos6 阿里云yum源地址:

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

Centos7 阿里云yum地址:

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

Centos6 163yum源地址:

 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo

Centos7 163yum源地址:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

3. 清除缓存

yum clean all

 

4. 生成缓存

yum makecache

 

如果提示另外一个程序已经存在,使用kill -9 加进程ID杀掉线程。再运行一次yum makecache

 

 

posted @ 2020-02-12 17:41  leelice  阅读(400)  评论(0编辑  收藏  举报