yum更换源

1. 更换163源

https://mirrors.163.com/.help/centos.html

 

2. 更换中科大源

https://mirrors.ustc.edu.cn/help/centos.html

 

3. 更换清华源

https://mirrors.tuna.tsinghua.edu.cn/help/centos/

 

cd /etc/yum.repos.d

vim CentOS-Base.repo

写入:

复制代码
[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
复制代码

yum clean all

yum makecache

yum -y install update

 

4. 更换阿里源

https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b110mHduj

 

cd /etc/yum.repos.d

 mv CentOS-Base.repo CentOS-Base.repo.bak

wget -O CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

yum clean all

yum makecache

yum -y install update

 

5. 更换sohu源

http://mirrors.sohu.com/centos/

 

posted @   Shiyu_Huang  阅读(665)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
历史上的今天:
2019-04-04 Bayesian RL and PGMRL
2018-04-04 Linux之查看切换Shell
2017-04-04 NIPS(Conference and Workshop on Neural Information Processing Systems)
2017-04-04 CVPR(IEEE Conference on Computer Vision and Pattern Recognition)
点击右上角即可分享
微信分享提示