三步轻轻松松教你将 liunx CentOS 替换为国内的源

啥?yum 命令失效了,网络不可达?

第一步: 备份下系统自带的yum源配置文件/etc/yum.repos.d/CentOS-Base.repo

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup


第二步: 下载国内yum源配置文件到/etc/yum.repos.d/(阿里)

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

wget 没有,也无法下载不了没关系,本机访问下载下来直接传到指定的目录也可以。


第三步:清理yum缓存,并生成新的缓存,更新yum

# 依次执行下面三行命令
yum clean all

yum makecache

yum update

你可能感兴趣的:(centos,linux,运维)