美文网首页
CentOS6.x/7.x更改为网易163yum源

CentOS6.x/7.x更改为网易163yum源

作者: 静美书斋 | 来源:发表于2019-03-15 15:37 被阅读0次

国内 yum 源

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

# 查看有哪些源
yum repolsit
ls /etc/yum.repos.d/

安装步骤

第一步:备份/etc/yum.repos.d/CentOS-Base.repo
## 如果CentOS系统采用最小安装,则需要先安装wget工具
yum install -y wget

## 备份原生repo
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
第二部:下载对应版本repo文件, 放入/etc/yum.repos.d/(操作前请做好相应备份)
  • CentOS5

    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS5-Base-163.repo
    
  • CentOS6

    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo
    
  • CentOS7

    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
    
第三部:运行以下命令生成缓存
yum clean all && yum makecache
第四部分:更新系统(时间比较久,主要看个人网速)
yum check   #检测,可跳过
yum -y update

资料来源

相关文章

网友评论

      本文标题:CentOS6.x/7.x更改为网易163yum源

      本文链接:https://www.haomeiwen.com/subject/ydfrmqtx.html