Centos8修改源

1、备份CentOS-Linux-BaseOS.repo

mv /etc/yum.repos.d/CentOS-Linux-BaseOS.repo /etc/yum.repos.d/CentOS-Linux-BaseOS.repo.backup

2、获取 阿里yum 配置文件

wget -O /etc/yum.repos.d/CentOS-Linux-BaseOS.repo http://mirrors.aliyun.com/repo/Centos-8.repo

3、修改下载的CentOS-Linux-BaseOS.repo阿里配置文件中地址,镜像地址

cd /etc/yum.repos.d

vim CentOS-Linux-BaseOS.repo

所有mirrors.cloud.aliyuncs.com 替换为 mirrors.aliyun.com
所有releasever 替换为 releasever-stream

4、更新yum 缓存

yum mackecache

如果出现

Errors during downloading metadata for repository 'appstream':
  - Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/Devel/x86_64/os/repodata/repomd.xml (IP: 100.100.2.148)

Errors during downloading metadata for repository 'epel':
  - Status code: 404 for http://mirrors.cloud.aliyuncs.com/centos/8/Devel/x86_64/os/repodata/repomd.xml (IP: 100.100.2.148)

或其他提示类似提示,只需将/etc/yum.repos.d文件夹下对应的repo文件删除或修改文件名 尾部.backup,因为访问的还是原来的地址 不是新下载及修改后CentOS-Linux-BaseOS.repo中的地址

 镜像地址https://mirrors.aliyun.com/centos/8-stream/BaseOS/x86_64/os/repodata/repomd.xml

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

少十步

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值