centos8.2换源填坑的一天20220323

客户那里拿到了一个机子,想装个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解决