以下为修改Centos7的yum源:
1. 备份原镜像文件,便于后期恢复
[[email protected] ~]# 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
原文地址:https://www.cnblogs.com/leelice/p/12299932.html
时间: 2024-11-08 11:30:57