报错类似:
file /usr/lib/python3.6/site-packages/podman/client.py from install of python-podman-api-1.2.0-0.2.gitd0a45fe.module_el8.3.0+475+c50ce30b.noarch conflicts with file from package python3-podman-3.2.0-2.module_el8.5.0+890+6b136101.noarch
Error: Transaction test error: file /etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release from install of containers-common-2:1-2.module_el8.5.0+890+6b136101.noarch conflicts with file from package redhat-release-8.3-1.0.el8.x86_64
上面这些报错大概意思是2个版本冲突
那就卸载一个版本
rpm -e --nodeps pthon3-podman-3.2.0-2
直接说解决方法:
1、修改yum镜像仓库为
[root@localhost yum.repos.d]# pwd
/etc/yum.repos.d
[root@localhost yum.repos.d]# vi CentOS-Base.repo
[base]
name=CentOS-8.3.2011 - Base - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.3.2011/BaseOS/$basearch/os/
http://mirrors.aliyuncs.com/centos-vault/8.3.2011/BaseOS/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos-vault/8.3.2011/BaseOS/$basearch/os/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
#additional packages that may be useful
[extras]
name=CentOS-8.3.2011 - Extras - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.3.2011/extras/$basearch/os/
http://mirrors.aliyuncs.com/centos-vault/8.3.2011/extras/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos-vault/8.3.2011/extras/$basearch/os/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-8.3.2011 - Plus - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.3.2011/centosplus/$basearch/os/
http://mirrors.aliyuncs.com/centos-vault/8.3.2011/centosplus/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos-vault/8.3.2011/centosplus/$basearch/os/
gpgcheck=0
enabled=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
[PowerTools]
name=CentOS-8.3.2011 - PowerTools - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.3.2011/PowerTools/$basearch/os/
http://mirrors.aliyuncs.com/centos-vault/8.3.2011/PowerTools/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos-vault/8.3.2011/PowerTools/$basearch/os/
gpgcheck=0
enabled=1
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
[AppStream]
name=CentOS-8.3.2011 - AppStream - mirrors.aliyun.com
baseurl=http://mirrors.aliyun.com/centos-vault/8.3.2011/AppStream/$basearch/os/
http://mirrors.aliyuncs.com/centos-vault/8.3.2011/AppStream/$basearch/os/
http://mirrors.cloud.aliyuncs.com/centos-vault/8.3.2011/AppStream/$basearch/os/
gpgcheck=0
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-Official
dnf或者yum clean all
dnf或者yum makecache
再去执行安装podman成功。
注意如果你获取不到$releaserver,像我这样就是没有安装centos-server,所以不能获取$releasever这个变量
[root@localhost yum.repos.d]# rpm -qi centos-server
package centos-server is not installed
那就修改网上的源$releaserver改成你系统的实际版本,8.3.2011。还有修改全部enable=1