Vor*_*ity 3 yum docker centos7
编辑:如果可能的话,我仍然希望得到这个问题的答案,但我已经设法通过直接安装各个 rpms 而不是依靠 yum 来解决它。
我正在努力在 CentOS 7 机器上安装 docker-ce。我将它安装在其他三个盒子上,但第四个给了我问题。我正在按照此处的说明进行操作。安装 repo 似乎有效,但docker-ce无论我尝试什么,似乎都不可用。
$ sudo yum-config-manager \
> --add-repo \
> https://download.docker.com/linux/centos/docker-ce.repo
Loaded plugins: fastestmirror, langpacks
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
$ ls /etc/yum.repos.d/docker-ce.repo
/etc/yum.repos.d/docker-ce.repo
# This should include docker-ce, docker-ce-cli, and a few other things
$ yum --disablerepo="*" --enablerepo="docker-ce-stable" list available
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Available Packages
containerd.io.x86_64 1.2.6-3.3.el7 docker-ce-stable
$ sudo yum install docker-ce
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: mirror.fileplanet.com
* epel: mirror.colorado.edu
* extras: mirrors.tummy.com
* updates: mirrors.tummy.com
No package docker-ce available.
Error: Nothing to do
Run Code Online (Sandbox Code Playgroud)
回购显然已启用。我可以containerd.io从 repo安装。看起来回购中没有其他可用的东西。即使我从另一个可以工作的 CentOS7 框中复制 repo,我仍然看不到 docker-ce 包。这个 repo 今晚在其他三个盒子上运行良好。
任何帮助,将不胜感激。提前致谢!
跑步yum clean all并 yum update没有帮助。
$ rm /etc/yum.repos.d/docker-ce.repo
rm: remove regular file ‘/etc/yum.repos.d/docker-ce.repo’? y
$ yum clean all
Loaded plugins: fastestmirror, langpacks
Cleaning repos: base epel extras updates
Cleaning up list of fastest mirrors
Other repos take up 18 M of disk space (use --verbose for details)
$ yum update
Loaded plugins: fastestmirror, langpacks
Determining fastest mirrors
epel/x86_64/metalink | 14 kB 00:00:00
* base: repos.forethought.net
* epel: d2lzkl7pfhq30w.cloudfront.net
* extras: repos.forethought.net
* updates: repos.forethought.net
base | 3.6 kB 00:00:00
epel | 5.4 kB 00:00:00
extras | 2.9 kB 00:00:00
updates | 2.9 kB 00:00:00
(1/7): base/7/x86_64/group_gz | 165 kB 00:00:00
(2/7): base/7/x86_64/primary_db | 6.0 MB 00:00:00
(3/7): epel/x86_64/group_gz | 90 kB 00:00:00
(4/7): epel/x86_64/updateinfo | 1.0 MB 00:00:00
(5/7): extras/7/x86_64/primary_db | 153 kB 00:00:00
(6/7): updates/7/x86_64/primary_db | 2.8 MB 00:00:00
(7/7): epel/x86_64/primary_db | 6.9 MB 00:00:01
No packages marked for update
$ yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Loaded plugins: fastestmirror, langpacks
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
$ yum list available | grep docker-ce
containerd.io.x86_64 1.2.10-3.2.el7 docker-ce-stable
$ yum install docker-ce
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
* base: repos.forethought.net
* epel: d2lzkl7pfhq30w.cloudfront.net
* extras: repos.forethought.net
* updates: repos.forethought.net
No package docker-ce available.
Error: Nothing to do
Run Code Online (Sandbox Code Playgroud)
$ yum --disablerepo="*" --enablerepo="docker-ce-stable" list available
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
Available Packages
containerd.io.x86_64 1.2.10-3.2.el7 docker-ce-stable
Run Code Online (Sandbox Code Playgroud)
有很多方法可以强制 yum 排除 repo。其中之一是通过在exclude上设置指令/etc/yum.conf。此配置优先于--disablerepo和--enablerepo标志。
您必须检查您的/etc/yum.conf,删除排除或使用--disableexcludes=all标志强制 yum 忽略它。
Run Code Online (Sandbox Code Playgroud)--disableexcludes=[all|main|repoid] Disable the excludes defined in your config files. Takes one of three options: all == disable all excludes main == disable excludes defined in [main] in yum.conf repoid == disable excludes defined for that repo
例如:
yum --disablerepo="*" --enablerepo="docker-ce-stable" --disableexcludes=all list available
| 归档时间: |
|
| 查看次数: |
5350 次 |
| 最近记录: |