更换各种源的方法

记录各种需要换源的应用

更换yum源

替换为阿里源

备份

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

替换

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

生成缓存

1
yum makecache

更新软件列表

1
yum -y update

image-20240730205730178

使用国内源就非常快了