2修改国内yum源1

Posted whxiao

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了2修改国内yum源1相关的知识,希望对你有一定的参考价值。

1、清华源

[base]
name=CentOS-$releasever - Base
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

 

 2、将上面的配置替换替换到下面配置中

vi /etc/yum.repo.d/Centos-Base.repo

 

3、生效

yum clean all
yum makecache

 

以上是关于2修改国内yum源1的主要内容,如果未能解决你的问题,请参考以下文章

Linux(CentOS7.1)修改默认yum源为国内的阿里云yum源

Linux(CentOS7.1)修改默认yum源为国内的阿里云yum源

修改Centos默认yum源换成国内源

Centos-7修改yum源为国内的yum源

修改CentOS默认yum源为国内yum镜像源

Linux-修改CentOS默认yum源