centos8.2换源填坑的一天20220323

博主在尝试为CentOS 8安装Docker时遇到了各种问题,包括源的更换不成功、下载错误等。最终通过使用centos/8-steam/镜像并配置阿里云镜像站的CentOS流版源解决了问题。具体步骤包括更换yum.repos.d的repo文件、清理缓存、安装Docker,并用yum install --allow-erasing docker-ce解决报错。
摘要由CSDN通过智能技术生成

客户那里拿到了一个机子,想装个docker,换源搞半天。。

centos镜像-centos下载地址-centos安装教程-阿里巴巴开源镜像站

不成功。。

CentOS 8 EOL如何切换源? - 云服务器 ECS - 阿里云

不成功。。

其他帖子,各种尝试,用centos-vault 就是不成功:

     http://mirrors.aliyuncs.com/centos-vault 打不开
     http://mirrors.cloud.aliyuncs.com/centos-vault 打不开

     repomd.xml下载不了、parser error

     下载成功,but checksum doesn't match ,sha256不对

     等等。。

可能是我的版本或者配置有问题。。

最后用了centos/8-steam/ ,终于ok了

Centos8修改源_少十步的博客-CSDN博客_centos8 源

 配置文件:


[base]
name=CentOS-$releasever-stream - Base - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever-stream/BaseOS/$basearch/os/
        http://mirrors.aliyuncs.com/centos/$releasever-stream/BaseOS/$basearch/os/
        http://mirrors.aliyun.com/centos/$releasever-stream/BaseOS/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

#additional packages that may be useful
[extras]
name=CentOS-$releasever-stream - Extras - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever-stream/extras/$basearch/os/
        http://mirrors.aliyuncs.com/centos/$releasever-stream/extras/$basearch/os/
        http://mirrors.aliyun.com/centos/$releasever-stream/extras/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever-stream - Plus - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever-stream/centosplus/$basearch/os/
        http://mirrors.aliyuncs.com/centos/$releasever-stream/centosplus/$basearch/os/
        http://mirrors.aliyun.com/centos/$releasever-stream/centosplus/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official

[PowerTools]
name=CentOS-$releasever-stream - PowerTools - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever-stream/PowerTools/$basearch/os/
        http://mirrors.aliyuncs.com/centos/$releasever-stream/PowerTools/$basearch/os/
        http://mirrors.aliyun.com/centos/$releasever-stream/PowerTools/$basearch/os/
gpgcheck=1
enabled=0
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official


[AppStream]
name=CentOS-$releasever-stream - AppStream - mirrors.aliyun.com
#failovermethod=priority
baseurl=https://mirrors.aliyun.com/centos/$releasever-stream/AppStream/$basearch/os/
        http://mirrors.aliyuncs.com/centos/$releasever-stream/AppStream/$basearch/os/
        http://mirrors.aliyun.com/centos/$releasever-stream/AppStream/$basearch/os/
gpgcheck=1
gpgkey=https://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
~
~
~

那个mirrors.cloud.aliyuncs.com替换成mirrors.aliyun.com了,请忽略。。

步骤:

1、进目录cd /etc/yum.repos.d

2、备份repo

3、删除 rm -rf *

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

5、换成stream的路径  sed -i 's/releasever/releasever-stream/g' /etc/yum.repos.d/CentOS-Linux-BaseOS.repo

6、yum makecache

装docker 

CentOS8 安装 Docker-阿里云开发者社区

遇到报错:podman xxxx

使用 yum install --allowerasing docker-ce解决

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值