Redhat 8.0 yum换网络源cent8(阿里)

这里我用的是阿里源cent8.5,清华源的cent8相关内容已经找不到资源

redhat8如果换源为cent7的,可能会产生问题

1.保险起见,先备份原来的repo文件(此处为 xxx.repo)

mv ggm.repo ggm.repo.backup

2.由于默认用原xxx.repo    避免冲突,删除原xxx.repo

rm -rf ggm.repo

3.下载新的repo到指定目录 /etc/yum.repos.d/

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

4.下载的目录下配置新repo 

vi CentOS-Base.repo

要在每个仓库下面一行加上enabled=1,注意前后不要有空格

此处建议删除原来的$变量

[base]
name=CentOS- Base - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/8.5.2111/BaseOS/x86_64/os/
gpgcheck=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
enabled=1
#additional packages that may be useful
[extras]
name=CentOS- Extras - mirrors.

你可能感兴趣的:(linux,yum源,Redhat,8.0)