運氣好時很是順利,一個 rpm 包,一執行安裝,就完成了,好比今天在單位的虛擬機上。運氣沒那麼好的時候,要手動安裝一些信賴,好比下班回家後的我。感謝運氣不那麼好,要否則就不會整理這篇文檔了。mysql
安裝包集合:https://download.docker.com/linux/centos/7/x86_64/stable/Packages/linux
這次安裝用到了列表中的:sql
白天虛擬機上,居然只安裝 docker-ce-18.09.4-3.el7.x86_64.rpm 就能夠了,結果晚上雲服務器上陸續出現下面的問題docker
嘗試直接安裝 docker-ce-18.09.4-3.el7.x86_64.rpmcentos
[root@iZxxxxxwuf9Z ftp_user]# yum install ./docker-ce-18.09.4-3.el7.x86_64.rpm Loaded plugins: fastestmirror Examining ./docker-ce-18.09.4-3.el7.x86_64.rpm: 3:docker-ce-18.09.4-3.el7.x86_64 Marking ./docker-ce-18.09.4-3.el7.x86_64.rpm to be installed **************此處省略一大堆輸出************** --> Finished Dependency Resolution Error: Package: 3:docker-ce-18.09.4-3.el7.x86_64 (/docker-ce-18.09.4-3.el7.x86_64) Requires: docker-ce-cli Error: Package: 3:docker-ce-18.09.4-3.el7.x86_64 (/docker-ce-18.09.4-3.el7.x86_64) Requires: containerd.io >= 1.2.2-3 You could try using --skip-broken to work around the problem ** Found 2 pre-existing rpmdb problem(s), 'yum check' output follows: 2:postfix-2.10.1-6.el7.x86_64 has missing requires of libmysqlclient.so.18()(64bit) 2:postfix-2.10.1-6.el7.x86_64 has missing requires of libmysqlclient.so.18(libmysqlclient_18)(64bit) [root@iZxxxxxwuf9Z ftp_user]#
根據提示,「Requires: docker-ce-cli」 和 「Requires: containerd.io >= 1.2.2-3」,因此安裝了前面提到的另外兩個 rpm 文件。服務器
[root@iZxxxxxwuf9Z ftp_user]# yum install containerd.io-1.2.5-3.1.el7.x86_64.rpm **************此處省略一大堆輸出************** [root@iZxxxxxwuf9Z ftp_user]# yum install docker-ce-cli-18.09.4-3.el7.x86_64.rpm **************此處省略一大堆輸出************** [root@iZxxxxxwuf9Z ftp_user]#
再嘗試安裝 docker-ce-18.09.4-3.el7.x86_64.rpmapp
[root@iZxxxxxwuf9Z ftp_user]# yum install ./docker-ce-18.09.4-3.el7.x86_64.rpm Loaded plugins: fastestmirror Examining ./docker-ce-18.09.4-3.el7.x86_64.rpm: 3:docker-ce-18.09.4-3.el7.x86_64 Marking ./docker-ce-18.09.4-3.el7.x86_64.rpm to be installed Resolving Dependencies **************此處省略一大堆輸出************** Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. Error downloading packages: selinux-policy-targeted-3.13.1-229.el7_6.9.noarch: [Errno 5] [Errno 12] Cannot allocate memory **************此處省略一大堆輸出************** libsepol-devel-2.5-10.el7.x86_64: [Errno 5] [Errno 12] Cannot allocate memory
根據提示 「because /usr/bin/applydeltarpm not installed」,因此以下操做ide
[root@iZxxxxxwuf9Z ftp_user]# yum provides '*/applydeltarpm' Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile base/7/x86_64/filelists_db | 7.1 MB 00:00:00 epel/x86_64/filelists_db | 11 MB 00:00:00 extras/7/x86_64/filelists_db | 236 kB 00:00:00 updates/7/x86_64/filelists_db | 2.7 MB 00:00:00 deltarpm-3.6-3.el7.x86_64 : Create deltas between rpms Repo : base Matched from: Filename : /usr/bin/applydeltarpm
原來是 deltarpm-3.6-3.el7.x86_64 的問題,因此繼續操做post
[root@iZxxxxxwuf9Z ftp_user]# yum install deltarpm Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ---> Package deltarpm.x86_64 0:3.6-3.el7 will be installed --> Finished Dependency Resolution **************此處省略一大堆輸出************** Complete!
最後一次嘗試安裝 docker-ce-18.09.4-3.el7.x86_64.rpmui
[root@iZxxxxxwuf9Z ftp_user]# yum install docker-ce-18.09.4-3.el7.x86_64.rpm Loaded plugins: fastestmirror Examining docker-ce-18.09.4-3.el7.x86_64.rpm: 3:docker-ce-18.09.4-3.el7.x86_64 Marking docker-ce-18.09.4-3.el7.x86_64.rpm to be installed Resolving Dependencies **************此處省略一大堆輸出************** Complete! [root@iZxxxxxwuf9Z ftp_user]#
愉快完成
參考:官方文檔