Centos替换默认源

时间:2023-03-09 16:00:07
Centos替换默认源

将默认的国外源替换为国内的网易的源

参考帮助文档:http://mirrors.163.com/.help/centos.html

查看本机版本:cat /etc/redhat-release

先安装wget:yum install wget

默认源的备份与网易源的安装:

备份:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
切换目录:
cd /etc/yum.repos.d/

选择版本下载安装(我的是6版本)
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo

再执行下面两个命令
yum clean all
yum makecache