CentOS 8 更换yum国内源
CentOS,是基于Red Hat Linux提供的可自由使用源代码的企业级Linux发行版本;是一个稳定,可预测,可管理和可复制的免费企业级计算平台。
下载地址: https://mirrors.aliyun.com/centos/
相关仓库:
CentOS过期源(centos-vault):https://developer.aliyun.com/mirror/centos-vault
CentOS arm源(centos-altarch):https://developer.aliyun.com/mirror/centos-altarch/
CentOS Stream源(centos-stream):https://developer.aliyun.com/mirror/centos-stream
CentOS debuginfo源(centos-debuginfo):https://developer.aliyun.com/mirror/centos-debuginfo/
进入root,切换至yum.repos.d目录
cd /etc/yum.repos.d/
创建新文件夹并将源文件备份为repo.bak
mkdir backup && mv *repo backup/
下载国内yum源文件
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
更新下载yum源地址
sed -i -e"s|mirrors.cloud.aliyuncs.com|mirrors.aliyun.com|g " /etc/yum.repos.d/CentOS-*
sed -i -e "s|releasever|releasever-stream|g" /etc/yum.repos.d/CentOS-*
生成缓存
yum clean all && yum makecache
Comment