轶哥

📚 Having fun with AI Agent. Always learning.

    CentOS8卸载podman安装docker
    •   更新:2021-03-14 22:18:31
    •   首发:2021-03-14 21:40:43
    •   教程
    •   12923

    由于CentOS8默认安装了podman,因此在CentOS8中安装docker会导致冲突引发如下异常。

    Error: 
     Problem 1: problem with installed package podman-2.0.5-5.module_el8.3.0+512+b3b58dca.x86_64
      - package podman-2.0.5-5.module_el8.3.0+512+b3b58dca.x86_64 requires runc >= 1.0.0-57, but none of the providers can be installed
      - package containerd.io-1.4.3-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64
      - package containerd.io-1.4.3-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64
      - cannot install the best candidate for the job
      - package runc-1.0.0-64.rc10.module_el8.3.0+479+69e2ae26.x86_64 is filtered out by modular filtering
     Problem 2: problem with installed package buildah-1.15.1-2.module_el8.3.0+475+c50ce30b.x86_64
      - package buildah-1.15.1-2.module_el8.3.0+475+c50ce30b.x86_64 requires runc >= 1.0.0-26, but none of the providers can be installed
      - package docker-ce-3:20.10.1-3.el8.x86_64 requires containerd.io >= 1.4.1, but none of the providers can be installed
      - package containerd.io-1.4.3-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64
      - package containerd.io-1.4.3-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64
      - package containerd.io-1.4.1-3.1.el8.x86_64 conflicts with runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64
      - package containerd.io-1.4.1-3.1.el8.x86_64 obsoletes runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64
      - package containerd.io-1.4.3-3.el8.x86_64 conflicts with runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64
      - package containerd.io-1.4.3-3.el8.x86_64 obsoletes runc provided by runc-1.0.0-68.rc92.module_el8.3.0+475+c50ce30b.x86_64
      - cannot install the best candidate for the job
      - package runc-1.0.0-56.rc5.dev.git2abd837.module_el8.3.0+569+1bada2e4.x86_64 is filtered out by modular filtering
      - package runc-1.0.0-64.rc10.module_el8.3.0+479+69e2ae26.x86_64 is filtered out by modular filtering
    

    在部分场景中却不得不使用docker,因为podman是新东西,即便命令和docker及其相似,也因为生态原因,各类API还无法完全兼容。例如《【视频教程】Electron自动编译及自动更新、分发》就对这个情况进行过说明,在使用Electron 应用分发系统的时候,由于使用了开源项目dockerode对docker进行控制,因此需要卸载podman改用docker

    卸载podman

    yum -y erase podman buildah
    

    卸载完成后无需重启,可直接安装docker

    注: 如果不是迫不得已,推荐大家使用podman,和docker命令非常相似。

    安装Docker

    curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh
    

    国内设备使用阿里云加速安装:

    curl -fsSL https://get.docker.com -o get-docker.sh && sh get-docker.sh --mirror Aliyun
    

    以上命令会自动判断所在的环境,适用于大部分*unix操作系统和架构。包括Raspberry Pi等ARM架构的设备。

    如果你希望以非root用户运行docker,安装完成后添加用户到docker组:

    sudo usermod -aG docker your-user
    

    设置开机启动:

    systemctl enable docker
    

    启动docker:

    systemctl start docker
    
    打赏
    交流区(2)
    人要有梦想

    想问下,m1虚拟的centos strem9,卸载了podman,然后使用docker,但是发现使用docker exec -it xxx bash进入容器的时候,一直报错OCI runtime exec failed: exec failed: unable to start container process: open /dev/pts/0: operation not permitted: unknown

    nginx latest镜像,不知道你有没有遇到过

    2022年8月13日 10:37回复
    轶哥

    换成sh能进吗?

    2022年8月13日 12:20回复
    尚未登陆
    发布
      上一篇 (Electron 12+ 出现 require is not defined 报错解决)
    下一篇 (ubuntu 20.04 安装 pip2)  

    评论回复提醒