【centos】更换yum源

it2026-08-26  9

yum下载有时候很慢,可以换一下源: 步骤:

1)下载wget yum install -y wget 2)备份默认的yum mv /etc/yum.repos.d /etc/yum.repos.d.backup 3)设置新的yum目录 mkdir /etc/yum.repos.d 4)下载阿里yum配置到该目录中 wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo 5)重建缓存 yum clean all yum makecache 6)升级所有包(改变软件设置和系统设置,系统版本内核都升级,故需要几分钟耐心等待) yum update -y
最新回复(0)