Centos7更换yum国内源

更换yum国内源


本文来源于:链接: https://www.runoob.com/linux/linux-yum.html.

网易(163)yum源是国内最好的yum源之一 ,无论是速度还是软件版本,都非常的不错。将yum源设置为163 yum,可以提升软件包安装和更新的速度,同时避免一些常见软件版本无法找到。

安装步骤
首先备份/etc/yum.repos.d/CentOS-Base.repo

cd /etc/yum.repos.d 

进入到这个文件夹后进行备份

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

下载对应版本 repo 文件, 放入 /etc/yum.repos.d/ (操作前请做好相应备份)

    CentOS5 :http://mirrors.163.com/.help/CentOS5-Base-163.repo
    CentOS6 :http://mirrors.163.com/.help/CentOS6-Base-163.repo
    CentOS7 :http://mirrors.163.com/.help/CentOS7-Base-163.repo
wget http://mirrors.163.com/.help/CentOS7-Base-163.repo
mv CentOS7-Base-163.repo CentOS-Base.repo

运行以下命令生成缓存

yum clean all
yum makecache

除了网易之外,国内还有其他不错的 yum 源,比如中科大和搜狐。

中科大的 yum 源,安装方法查看:https://lug.ustc.edu.cn/wiki/mirrors/help/centos

sohu 的 yum 源安装方法查看: http://mirrors.sohu.com/help/centos.html

猜你喜欢

转载自blog.csdn.net/qq_43537319/article/details/120921200