centos系统更新、yum安装慢?试试将国外源替换为国内源,例如阿里源

  • A+
所属分类:Linux

CentOS,repo,repo文件做什么的,repo源更换,yum安装软件,yum更新,yum更新慢,yum源,yum默认源,更换源,替换repo,阿里源,centos系统更新、yum安装慢?试试将国外源替换为国内源,例如阿里源1、先备份默认的repo源文件

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

2、下载阿里云提供的源并重新命名为CentOS-Base.repo
CentOS 6.x适用

1
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

CentOS 7.x适用

1
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

CentOS 8.x适用

1
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo

3、清空并重建yum缓存
清空yum缓存

1
yum clean all

重新生成缓存

1
yum makecache

发表评论

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: