【问题标题】:dependency error while installing docker 1.12 in rhel 7在 rhel 7 中安装 docker 1.12 时出现依赖错误
【发布时间】:2023-03-04 07:58:07
【问题描述】:

目标:在 rhel 7 中以离线模式安装最新的 docker (v1.12)

  • 在 rhel 7 中安装 docker 1.12 时出现依赖错误,我 试图在互联网上找到那些依赖项,但没有找到那些 selinux-policy rpm 以外的依赖项。

  • 我尝试在 yum update 之后安装。
  • 我在 Internet 上找到了 docker 1.7 的依赖项,安装在 rhel 6.7 中 但无法为 rhel 7 中的 docker 1.12 采用相同的方式

我尝试了以下事情

  • 当系统(测试机)连接到互联网时安装了 docker 1.12,安装 docker 1.12 后,所有依赖项将缓存在 /var/cahce/yum/rhel7/ 位置并搜索上述依赖项但没有没有找到。
  • 创建本地 yum 存储库并挂载 iso 文件,然后进行 yum 更新 并尝试安装 docker 但仍然给出相同的依赖项错误。

  • 我不确定上述步骤是否正确或正确的程序,我只是累了,但什么都没有用。

    我的生产环境没有互联网连接,只有内网连接。

    • 有人可以提供或建议我如何解决这个问题以及如何处理这类问题吗?

提前致谢!

【问题讨论】:

    标签: linux docker rhel7


    【解决方案1】:

    我很惊讶您至少在这里找不到非 docker 软件包,因为它们来自标准 CentOS 存储库。一般来说,我会使用类似的东西:

    # yum provides "*/<filename>"
    

    例如

    # yum provides "*/libsystemd.so.*"
    

    如果您没有在目标系统上配置存储库,这显然无济于事,但是运行 Vagrant VM 并查看那里需要什么非常容易。

    $ vagrant init bento/centos-7.2
    $ vagrant ssh
    

    然后按照https://docs.docker.com/engine/installation/linux/centos/ 的文档:

    $ sudo tee /etc/yum.repos.d/docker.repo <<-'EOF'
    [dockerrepo]
    name=Docker Repository
    baseurl=https://yum.dockerproject.org/repo/main/centos/7/
    enabled=1
    gpgcheck=1
    gpgkey=https://yum.dockerproject.org/gpg
    EOF
    

    并安装它:

    $ sudo yum install docker-engine
    

    对我来说,这给出了:

    [vagrant@localhost ~]$ sudo yum install docker-engine
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirror.ukhost4u.com
     * extras: mirror.vorboss.net
     * updates: mirror.vorboss.net
    Resolving Dependencies
    --> Running transaction check
    ---> Package docker-engine.x86_64 0:1.12.1-1.el7.centos will be installed
    --> Processing Dependency: docker-engine-selinux >= 1.12.1-1.el7.centos for package: docker-engine-1.12.1-1.el7.centos.x86_64
    --> Processing Dependency: libseccomp.so.2()(64bit) for package: docker-engine-1.12.1-1.el7.centos.x86_64
    --> Processing Dependency: libltdl.so.7()(64bit) for package: docker-engine-1.12.1-1.el7.centos.x86_64
    --> Running transaction check
    ---> Package docker-engine-selinux.noarch 0:1.12.1-1.el7.centos will be installed
    ---> Package libseccomp.x86_64 0:2.2.1-1.el7 will be installed
    ---> Package libtool-ltdl.x86_64 0:2.4.2-21.el7_2 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ============================================================================================================
    
     Package                         Arch             Version                        Repository            Size ============================================================================================================
    
    Installing:
     docker-engine                   x86_64           1.12.1-1.el7.centos            dockerrepo            19 M Installing for dependencies:
     docker-engine-selinux           noarch           1.12.1-1.el7.centos            dockerrepo            28 k  libseccomp                      x86_64           2.2.1-1.el7                    base                  49 k  libtool-ltdl                    x86_64           2.4.2-21.el7_2                 updates               49 k
    
    Transaction Summary
    ============================================================================================================
    
    Install  1 Package (+3 Dependent packages)
    
    Total download size: 19 M
    Installed size: 79 M
    

    运行我在上面给出的yum provides 命令向您展示了例如libsystemd.so* 位于 systemd-libs 包中,可在“更新”存储库中找到。请参阅 http://mirror.centos.org/centos/7/updates/x86_64/Packages/

    【讨论】:

      【解决方案2】:

      试试这个命令: 百胜安装 libtool-ltdl 之后重新运行安装命令。 如果您有“docker-ce”存储库,这将自动完成。 祝你好运!

      【讨论】:

        猜你喜欢
        • 2013-05-07
        • 1970-01-01
        • 1970-01-01
        • 2021-09-10
        • 2011-11-18
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2020-08-27
        相关资源
        最近更新 更多