Centos8.1 Linux更改yum源

Centos8.1下载慢,随手百度,方法都是推荐更换国内的yum源。
按照推荐的方法,发现老是出现
错误:为 repo ‘base’ 下载元数据失败
搞了一夜才发现,源网址都是对应系统版本号的,如今的资料都是针历史版本的。
你们能够按照以下流程修改源
1.备份现有源
mv /etc/yum.repos.d /etc/yum.repos.d.backup
2.设置新的yum目录
mkdir /etc/yum.repos.d
3.安装wget(我没安装,也没事,多是我之前安装过)
yum install -y wget
4.就是坑了我一夜的下载配置(你们必定要区分本身的系统版本,否则确定不经过)html

CentOS 5

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

CentOS 6

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

CentOS 7

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

CentOS 8

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-8.repo
5.清除文件并重建元数据缓存
yum clean all
yum makecache
6.最后更新软件包,这一步要下载安扎ung或升级一百多个软件包,比较费时间,大概三五分钟吧!
yum update -yxml

以上内容参考了网址https://www.cnblogs.com/Skate0rDie/p/11418287.htmlhtm