gpt4 book ai didi

mongodb - 无法打开文件/packages/repodata/repomd.xml

转载 作者:行者123 更新时间:2023-12-04 14:27:15 27 4
gpt4 key购买 nike

我正在使用 Redhat Linux 服务器并尝试在其上安装 MongoDB。

我正在按照链接中给出的步骤进行操作:https://docs.mongodb.com/manual/tutorial/install-mongodb-on-red-hat/

步骤 1 : 创建一个/etc/yum.repos.d/mongodb-org-4.0.repo 文件,以便您可以使用 yum 直接安装 MongoDB。

sudo nano /etc/yum.repos.d/mongodb-org-4.0.repo

步骤 2 :将以下代码复制并粘贴到新创建的文件中。
[mongodb-org-4.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/4.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-4.0.asc

步骤 3 :要安装特定版本的 MongoDB,请单独指定每个组件包并将版本号附加到包名称,如下例所示:
sudo yum install -y mongodb-org

毕竟,我收到以下错误消息:
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
file:///packages/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /packages/repodata/repomd.xml"
Trying other mirror.`


One of the configured repositories failed (local),
and yum doesn't have enough cached data to continue. At this point the only
safe thing yum can do is fail. There are a few ways to work "fix" this:`

1. Contact the upstream for the repository and get them to fix the problem.

2. Reconfigure the baseurl/etc. for the repository, to point to a working
upstream. This is most often useful if you are using a newer
distribution release than is supported by the repository (and the
packages for the previous distribution release still work).

3. Run the command with the repository temporarily disabled
yum --disablerepo=localrepo ...

4. Disable the repository permanently, so yum won't use it by default. Yum
will then just ignore the repository until you permanently enable it
again or use --enablerepo for temporary usage:

yum-config-manager --disable localrepo
or
subscription-manager repos --disable=localrepo

5. Configure the failing repository to be skipped, if it is unavailable.
Note that yum will try to contact the repo. when it runs most commands,
so will have to try and fail each time (and thus. yum will be be much
slower). If it is a very temporary problem though, this is often a nice
compromise:

yum-config-manager --save --setopt=localrepo.skip_if_unavailable=true

failure: repodata/repomd.xml from localrepo: [Errno 256] No more mirrors to try.
file:///packages/repodata/repomd.xml: [Errno 14] curl#37 - "Couldn't open file /packages/repodata/repomd.xml"

服务器操作系统
NAME="Red Hat Enterprise Linux Server"
VERSION="7.3 (Maipo)"
ID="rhel"
ID_LIKE="fedora"
VERSION_ID="7.3"
PRETTY_NAME="Red Hat Enterprise Linux"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.3:GA:server"
HOME_URL="https://www.redhat.com/"
BUG_REPORT_URL="https://bugzilla.redhat.com/"
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
REDHAT_BUGZILLA_PRODUCT_VERSION=7.3
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="7.3"

我已经按照以下步骤操作,但这些在我的情况下不起作用:
sudo rm -rf /etc/yum.repos.d/mongodb-org-4.0.repo

sudo yum clean all

我该如何解决这个错误?

最佳答案

根据您的错误消息,您似乎遇到了名称服务器问题,这可能涉及多种解决方案,如 answer from redhat.com描述。我的 mongodb-org-4.0.repo文件看起来和你的一样,除了 4.4 版,一切正常。好吧,一开始我不是这样找到这篇文章的,但我的问题是我不小心在 mongodb-org-4.4.repo 末尾插入了一个空格。文件。
我找到了这个 Unix & Linux Stack Exchange发布一些可能的修复,其中之一是更新到最新的 CentOS。此 ServerFault帖子也有您所看到的 Errno 14 错误消息,但此解决方案是禁用 SELinux。

关于mongodb - 无法打开文件/packages/repodata/repomd.xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55461382/

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