1495

Centos7更换国内源

备份yum源

cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak

安装国内源

#阿里云源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

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

添加epel源

替换yum国内源后,仍然有很多软件无法通过yum install安装,此时需要安装epel后,就可以直接使用yum install安装更多软件了.

wget -P /etc/yum.repos.d/ http://mirrors.aliyun.com/repo/epel-7.repo

缓存

#清缓存
yum clean all

#重建换成
yum makecache
文章作者:DOTATONG
发布日期:2021-09-23
# centos

评论

暂无

添加新评论