0.安装yum优先级插件
yum install yum-priorities
1.epel简介: https://fedoraproject.org/wiki/EPEL/zh-cn
rpm -Uvh http://mirrors.ustc.edu.cn/fedora/epel/6/x86_64/epel-release-6-8.noarch.rpm rpm -Uvh http://rpms.famillecollet.com/enterprise/remi-release-6.rpm
以上URL请按实际情况修改
2.查看是否安装成功
rpm -q epel-release
3.导入key:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
4.修改/etc/yum.repos.d/epel.repo文件
在[epel]最后添加一条属性 priority=11
vi /etc/yum.repos.d/epel.repo
意思是yum先去官方源查,官方没有再去epel的源找
5.重建缓存
yum makecache
yum -y install docker-io //安装docker守护进程
如果docker
安装失败那么将/etc/yum.repos.d/epel.repo 替换为阿里云内容
阿里云内容如下
[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
[epel-debuginfo]
name=Extra Packages for Enterprise Linux 6 - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-debug-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
[epel-source]
name=Extra Packages for Enterprise Linux 6 - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-source-6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1
~
报错解决
INFO[0000] +job serveapi(unix:///var/run/docker.sock)
INFO[0000] WARNING: You are running Linux kernel version 2.6.32-431.el6.x86_64, which might be unstable running docker. Please upgrade your kernel to 3.8.0.
docker: relocation error: docker: symbol dm_task_get_info_with_deferred_remove, version Base not defined in file libdevmapper.so.1.02 with link time reference
[root@oracledb ~]# yum upgrade device-mapper-libs
解决办法:
执行:yum upgrade device-mapper-libs