Bri*_*SP2 2 yum centos mongodb
我正在尝试安装由MongoDB指导的 mongodb v3.4 。
首先我创建“/etc/yum.repo.d/mongodb.repo”,然后我将此repo信息粘贴到文件中:
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
Run Code Online (Sandbox Code Playgroud)
我尝试安装 mongodb-org,但我从 yum 收到以下错误:
Loaded plugins: fastestmirror
base
| 3.6 kB 00:00:00
extras
| 3.4 kB 00:00:00
https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.4/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 403 - Forbidden
Trying other mirror.
To address this issue please refer to the below knowledge base article
https://access.redhat.com/solutions/69319
If above article doesn't help to resolve this issue please create a bug on https://bugs.centos.org/
One of the configured repositories failed (MongoDB Repository),
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=mongodb-org-3.4 ...
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 mongodb-org-3.4
or
subscription-manager repos --disable=mongodb-org-3.4
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=mongodb-org-3.4.skip_if_unavailable=true
failure: repodata/repomd.xml from mongodb-org-3.4: [Errno 256] No more mirrors to try.
https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.4/x86_64/repodata/repomd.xml: [Errno 14] HTTPS Error 403 - Forbidden
Run Code Online (Sandbox Code Playgroud)
这个错误是因为 SELinux 限制吗?我应该如何让 yum 安装 mongodb?
小智 8
这可能为时已晚,但在遇到同样的问题后,我遵循了在 AWS Linux 上通过 yum 安装 MongoDB 失败的组合:HTTPS 错误 404 - 未找到(在堆栈溢出中)以及安装 MongoDB 时对Yum 错误的响应之一在 CentOS 上?(不是选定的),所以我的步骤是:
sudo rm -rf /etc/yum.repos.d/mongod*
sudo yum clean all
Run Code Online (Sandbox Code Playgroud)
再次创建 repo 文件
sudo vi /etc/yum.repos.d/mongodb-org-3.4.repo
Run Code Online (Sandbox Code Playgroud)
粘贴以下内容(注意,对于我的系统,我将 '$releasever' 替换为 7):
[mongodb-org-3.4]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/redhat/7/mongodb-org/3.4/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-3.4.asc
Run Code Online (Sandbox Code Playgroud)
然后我运行了这个,它成功了:
sudo yum install -y mongodb-org
Run Code Online (Sandbox Code Playgroud)
归档时间: |
|
查看次数: |
15841 次 |
最近记录: |