执行rpm -q centos-release查看centos版本,执行uname -r 查看内核版本,系统位数:
参考文章:
Docker的安装,包括内核的升级(centos6内核太低需要升级到3.1以上)
1.导入public key:
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
2.安装ELRepo:
rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm
ELRepo地址可能回变动,需打开http://elrepo.org/tiki/tiki-index.php,自行选择
3.安装 kernel-lt(lt=long-term):
yum -y --enablerepo=elrepo-kernel install kernel-lt
出现下面提示,安装完成
4.修改系统默认启动内核, 编辑grub.conf文件:
vim /etc/grub.conf
5.重启验证内核版本是否已经更新
reboot
uname -a
yum-util提供yum-config-manager功能,另外两个是devicemapper驱动依赖
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install docker-ce -y
安装过程报错:Package: 3:docker-ce-19.03.6-3.el7.x86_64 (docker-ce-stable) Requires: container-selinux >= 2:2.74
---> Package docker-ce-cli.x86_64 1:19.03.6-3.el7 will be installed
---> Package libcgroup.x86_64 0:0.40.rc1-27.el6_10 will be installed
--> Finished Dependency Resolution
Error: Package: 3:docker-ce-19.03.6-3.el7.x86_64 (docker-ce-stable)
Requires: systemd
Error: Package: 3:docker-ce-19.03.6-3.el7.x86_64 (docker-ce-stable)
Requires: libseccomp.so.2()(64bit)
Error: Package: 3:docker-ce-19.03.6-3.el7.x86_64 (docker-ce-stable)
Requires: libsystemd.so.0()(64bit)
Error: Package: 3:docker-ce-19.03.6-3.el7.x86_64 (docker-ce-stable)
Requires: libseccomp >= 2.3
Error: Package: containerd.io-1.2.10-3.2.el7.x86_64 (docker-ce-stable)
Requires: container-selinux >= 2:2.74
Error: Package: containerd.io-1.2.10-3.2.el7.x86_64 (docker-ce-stable)
Requires: systemd
Error: Package: 3:docker-ce-19.03.6-3.el7.x86_64 (docker-ce-stable)
Requires: libsystemd.so.0(LIBSYSTEMD_209)(64bit)
Error: Package: 3:docker-ce-19.03.6-3.el7.x86_64 (docker-ce-stable)
Requires: container-selinux >= 2:2.74
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest
经过一番搜索,应该是默认下载的docker版本太高了,这里选择一个历史版本去安装:
yum list docker-ce --showduplicates 查看docker历史版本
安装18.03.1.ce版本,仍报错
[root@promote ~]# yum install docker-ce-18.03.1.ce
关闭selinux:
https://blog.csdn.net/u012371097/article/details/83787256
vi /etc/selinux/config
将SELINUX=enforcing改为SELINUX=disabled
然后重启:reboot ,依旧不行
在https://blog.csdn.net/qq_41772936/article/details/81080284 这个帖子中发现,需要先安全epel源
安装 Fedora EPEL
[root@promote ~]# yum -y install http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm
Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
epel-release-6-8.noarch.rpm | 14 kB 00:00
Examining /var/tmp/yum-root-A78x80/epel-release-6-8.noarch.rpm: epel-release-6-8.noarch
Marking /var/tmp/yum-root-A78x80/epel-release-6-8.noarch.rpm to be installed
Loading mirror speeds from cached hostfile
* base: mirrors.njupt.edu.cn
* elrepo: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.cn99.com
* updates: mirrors.cn99.com
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package epel-release.noarch 0:6-8 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================
Installing:
epel-release noarch 6-8 /epel-release-6-8.noarch 22 k
Transaction Summary
==============================================================================================================================================
Install 1 Package(s)
Total size: 22 k
Installed size: 22 k
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : epel-release-6-8.noarch 1/1
Verifying : epel-release-6-8.noarch 1/1
Installed:
epel-release.noarch 0:6-8
Complete!
之后就卡在了container-selinux上面,怎么安装都提示缺少依赖组件,更换centos7.3 ,轻松安装完成!