1、安装wget
yum install wget
2、进入yum源目录
cd /etc/yum.repos.d/
3、备份
mkdir repo_bak
mv *.repo repo_bak/
4、下载网易与阿里云的源
wget http://mirrors.aliyun.com/repo/Centos-7.repo
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
5、清理并生成新的yum缓存
yum clean all # 清除系统所有的yum缓存
yum makecache # 生成yum缓存
6、安装epel源
yum install -y epel-release
wget http://mirrors.aliyun.com/repo/epel-7.repo
7、清理并生成新的yum缓存
yum clean all # 清除系统所有的yum缓存
yum makecache # 生成yum缓存
8、查看
yum repolist enabled # 系统可用源
yum repolist all # 所有源
本文详细介绍了如何在CentOS系统中更换软件源的过程,包括安装wget、备份原yum源配置文件、下载并替换为网易与阿里云提供的高速源、安装epel源以及清理并生成新的yum缓存等步骤。
3779

被折叠的 条评论
为什么被折叠?



