Centos 7.2.1511版本安装docker碰到的问题

在Centos 7.2.1511上安装docker上碰到如下问题

[root@aaa ~]# yum install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm
Loaded plugins: fastestmirror, versionlock
docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm                                                                                                       |  28 kB  00:00:00
Examining /var/tmp/yum-root-mI2l3n/docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm: docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch
Marking /var/tmp/yum-root-mI2l3n/docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package docker-ce-selinux.noarch 0:17.03.2.ce-1.el7.centos will be installed
--> Processing Dependency: selinux-policy-base >= 3.13.1-102 for package: docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch
base                                                                                                                                                       | 3.6 kB  00:00:00
docker-ce-edge                                                                                                                                             | 2.9 kB  00:00:00
docker-ce-stable                                                                                                                                           | 2.9 kB  00:00:00
extras                                                                                                                                                     | 3.4 kB  00:00:00
puppetlabs-deps                                                                                                                                            | 2.9 kB  00:00:00
puppetlabs-products                                                                                                                                        | 2.9 kB  00:00:00
tools                                                                                                                                                      | 2.9 kB  00:00:00
updates-released                                                                                                                                           | 3.4 kB  00:00:00
Loading mirror speeds from cached hostfile
--> Processing Dependency: selinux-policy-targeted >= 3.13.1-102 for package: docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch
--> Finished Dependency Resolution
Error: Package: docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch (/docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch)
           Requires: selinux-policy-targeted >= 3.13.1-102
           Installed: selinux-policy-targeted-3.13.1-60.el7_2.9.noarch (@updates-released)
               selinux-policy-targeted = 3.13.1-60.el7_2.9
           Available: selinux-policy-targeted-3.13.1-60.el7.noarch (base)
               selinux-policy-targeted = 3.13.1-60.el7
           Available: selinux-policy-targeted-3.13.1-60.el7_2.3.noarch (updates-released)
               selinux-policy-targeted = 3.13.1-60.el7_2.3
           Available: selinux-policy-targeted-3.13.1-60.el7_2.7.noarch (updates-released)
               selinux-policy-targeted = 3.13.1-60.el7_2.7
Error: Package: docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch (/docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch)
           Requires: selinux-policy-base >= 3.13.1-102
           Installed: selinux-policy-targeted-3.13.1-60.el7_2.9.noarch (@updates-released)
               selinux-policy-base = 3.13.1-60.el7_2.9
           Available: selinux-policy-minimum-3.13.1-60.el7.noarch (base)
               selinux-policy-base = 3.13.1-60.el7
           Available: selinux-policy-minimum-3.13.1-60.el7_2.3.noarch (updates-released)
               selinux-policy-base = 3.13.1-60.el7_2.3

▽
           Available: selinux-policy-minimum-3.13.1-60.el7_2.7.noarch (updates-released)
               selinux-policy-base = 3.13.1-60.el7_2.7
           Available: selinux-policy-minimum-3.13.1-60.el7_2.9.noarch (updates-released)
               selinux-policy-base = 3.13.1-60.el7_2.9
           Available: selinux-policy-mls-3.13.1-60.el7.noarch (base)
               selinux-policy-base = 3.13.1-60.el7
           Available: selinux-policy-mls-3.13.1-60.el7_2.3.noarch (updates-released)
               selinux-policy-base = 3.13.1-60.el7_2.3
           Available: selinux-policy-mls-3.13.1-60.el7_2.7.noarch (updates-released)
               selinux-policy-base = 3.13.1-60.el7_2.7

▽
           Available: selinux-policy-mls-3.13.1-60.el7_2.9.noarch (updates-released)
               selinux-policy-base = 3.13.1-60.el7_2.9

▽
[base]
           Available: selinux-policy-targeted-3.13.1-60.el7.noarch (base)
               selinux-policy-base = 3.13.1-60.el7
           Available: selinux-policy-targeted-3.13.1-60.el7_2.3.noarch (updates-released)
               selinux-policy-base = 3.13.1-60.el7_2.3
           Available: selinux-policy-targeted-3.13.1-60.el7_2.7.noarch (updates-released)
               selinux-policy-base = 3.13.1-60.el7_2.7
 You could try using --skip-broken to work around the problem
 You could try running: rpm -Va --nofiles --nodigest

经过一番搜索,发现是系统的base.repo的问题
下面是上网查到的问题

This directory (and version of CentOS) is deprecated.  For normal users,
you should use /7/ and not /7.2.1511/ in your path. Please see this FAQ
concerning the CentOS release scheme:

https://wiki.centos.org/FAQ/General

If you know what you are doing, and absolutely want to remain at the 7.2.1511
level, go to http://vault.centos.org/ for packages. 

Please keep in mind that 7.2.1511 no longer gets any updates, nor
any security fix's.

这时候查看base.repo
vim /etc/yum.repos.d/base.repo

[base]
name=CentOS 7.2.1511 - x86_64 - Base
baseurl=http://repo.ops.aaa.com/yum/centos/7.2.1511/base/x86_64/
enabled=1
gpgcheck=0

现在只需要把这里面的版本7.2.1511改成7就好了

[base]
name=CentOS 7.2.1511 - x86_64 - Base
baseurl=http://repo.ops.aaa.com/yum/centos/7/base/x86_64/
enabled=1
gpgcheck=0

docker install in centos 7

yum install -y yum-utils \
           device-mapper-persistent-data \
           lvm2

yum-config-manager \
     --add-repo \
https://download.docker.com/linux/centos/docker-ce.repo

yum-config-manager --enable docker-ce-edge

yum install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm

yum install docker-ce-17.03.2.ce-1.el7.centos

curl -L https://github.com/docker/compose/releases/download/1.17.1/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +7 /usr/local/bin/docker-compose
mkdir /usr/local/tmpdir
vim ~/.bashrc
(Add the next sentence to the end)
export TMP=/usr/local/tmpdir


source ~/.bashrc

猜你喜欢

转载自blog.csdn.net/cckooo/article/details/80276578