gpt4 book ai didi

安装了 repo 的 docker-ce 没有出现在 `yum list available` 中

转载 作者:行者123 更新时间:2023-12-02 18:02:48 27 4
gpt4 key购买 nike

编辑:如果可能的话,我仍然想要这个问题的答案,但我已经设法通过直接安装各个 rpm 而不是依靠 yum 为我完成它来解决这个问题。

我正在努力在 CentOS 7 机器上安装 docker-ce。我将它安装在其他三个盒子上,但第四个给我带来了问题。我正在按照说明 here .安装 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

repo 显然已启用。我可以从存储库安装 containerd.io。 repo 协议(protocol)中似乎没有其他可用的东西。即使当我从另一个运行的 CentOS7 机器上复制 repo 时,我仍然看不到 docker-ce 包。这个 repo 今晚在其他三个盒子上运行良好。

如有任何帮助,我们将不胜感激。提前致谢!

编辑:

运行 yum clean allyum 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
$ 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

最佳答案

有很多方法可以强制 yum 排除 repo。其中之一是在 /etc/yum.conf 上设置 exclude 指令。此配置优先于 --disablerepo--enablerepo 标志。

您必须检查您的 /etc/yum.conf,使用 --disableexcludes=all 删除排除 强制 yum 忽略它> 旗帜。

--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=所有可用列表

关于安装了 repo 的 docker-ce 没有出现在 `yum list available` 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58021529/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com