我尝试在我的 AWS EC2 实例上安装 mongoDB。
Linux版本是:
`NAME=`"Amazon Linux"`
VERSION=`"2023"`
ID=`"amzn"`
ID_LIKE=`"fedora"`
VERSION_ID=`"2023"`
PLATFORM_ID=`"platform:al2023"`
PRETTY_NAME=`"Amazon Linux 2023"`
ANSI_COLOR=`"0;33"`
CPE_NAME=`"cpe:2.3:o:amazon:amazon_linux:2023"`
HOME_URL=`"https://aws.amazon.com/linux/"`
BUG_REPORT_URL=`"https://github.com/amazonlinux/amazon-linux-2023"`
SUPPORT_END=`"2028-03-01"`
`
我按照官方教程:Install MongoDB Community Edition on Amazon Linux --- MongoDB Manual
但是当我尝试时出现错误:yum install -y mongodb-org
:
Last` `metadata` `expiration` `check`: 0:24:24 `ago` `on` `Wed` `May` 24 21:06:16 2023.
`Error`:
`Problem`: `conflicting` `requests`
`-` `package` `mongodb-org-6.0.0-1.amzn2.x86_64` `requires` `mongodb-org-database`, `but` `none` `of` `the` `providers` `can` `be` `installed`
`-` `package` `mongodb-org-6.0.1-1.amzn2.x86_64` `requires` `mongodb-org-database`, `but` `none` `of` `the` `providers` `can` `be` `installed`
`-` `package` `mongodb-org-6.0.2-1.amzn2.x86_64` `requires` `mongodb-org-database`, `but` `none` `of` `the` `providers` `can` `be` `installed`
`-` `package` `mongodb-org-6.0.3-1.amzn2.x86_64` `requires` `mongodb-org-database`, `but` `none` `of` `the` `providers` `can` `be` `installed`
`-` `package` `mongodb-org-6.0.4-1.amzn2.x86_64` `requires` `mongodb-org-database`, `but` `none` `of` `the` `providers` `can` `be` `installed`
`-` `package` `mongodb-org-6.0.5-1.amzn2.x86_64` `requires` `mongodb-org-database`, `but` `none` `of` `the` `providers` `can` `be` `installed`
`-` `package` `mongodb-org-6.0.6-1.amzn2.x86_64` `requires` `mongodb-org-database`, `but` `none` `of` `the` `providers` `can` `be` `installed`
`-` `package` `mongodb-org-database-6.0.0-1.amzn2.x86_64` `requires` `mongodb-org-server`, `but` `none` `of` `the` `providers` `can` `be` `installed`
`-` `package` `mongodb-org-database-6.0.1-1.amzn2.x86_64` `requires` `mongodb-org-server`, `but` `none` `of` `the` `providers` `can` `be` `installed`
`-` `package` `mongodb-org-database-6.0.2-1.amzn2.x86_64` `requires` `mongodb-org-server`, `but` `none` `of` `the` `providers` `can` `be` `installed`
`-` `package` `mongodb-org-database-6.0.3-1.amzn2.x86_64` `requires` `mongodb-org-server`, `but` `none` `of` `the` `providers` `can` `be` `installed`
`-` `package` `mongodb-org-database-6.0.4-1.amzn2.x86_64` `requires` `mongodb-org-server`, `but` `none` `of` `the` `providers` `can` `be` `installed`
`-` `package` `mongodb-org-database-6.0.5-1.amzn2.x86_64` `requires` `mongodb-org-server`, `but` `none` `of` `the` `providers` `can` `be` `installed`
`-` `package` `mongodb-org-database-6.0.6-1.amzn2.x86_64` `requires` `mongodb-org-server`, `but` `none` `of` `the` `providers` `can` `be` `installed`
`-` `nothing` `provides` `libcrypto.so.10`()(64`bit`) `needed` `by` `mongodb-org-server-6.0.0-1.amzn2.x86_64`
`-` `nothing` `provides` `libcrypto.so.10`(`OPENSSL_1.0.2`)(64`bit`) `needed` `by` `mongodb-org-server-6.0.0-1.amzn2.x86_64`
`
如有任何帮助,我们将不胜感激。
最佳答案
编辑此内容并将其添加到此文件中:
/etc/yum.repos.d/mongodb-org-6.0.repo
lang-py
<span style="color:#212529"><span style="background-color:#ffffff"><span style="color:#212529"><code style="margin-left:2px">
[mongodb-org<span style="color:#ae7313">-6.0</span>]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/<span style="color:#ae7313">2</span>/mongodb-org/<span style="color:#ae7313">6.0</span>/x86_64/
gpgcheck=<span style="color:#ae7313">1</span>
enabled=<span style="color:#ae7313">1</span>
gpgkey=https://www.mongodb.org/static/pgp/server<span style="color:#ae7313">-6.0</span>.asc
// add this block below
[mongodb-org-AL2023]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/<span style="color:#ae7313">2023</span>/mongodb-org/development/x86_64/
gpgcheck=<span style="color:#ae7313">1</span>
enabled=<span style="color:#ae7313">1</span>
gpgkey=https://www.mongodb.org/static/pgp/server<span style="color:#ae7313">-7.0</span>.asc
</code></span></span></span>
然后运行此命令:
lang-bash
<span style="color:#212529"><span style="background-color:#ffffff"><span style="color:#212529"><code style="margin-left:2px">sudo yum install mongodb-org-database mongodb-org-database-tools-extra
</code></span></span></span>
应该可以用
关于mongodb - 无法按照官方教程在AWS EC2上安装mongoDB,我们在Stack Overflow上找到一个类似的问题: mongodb - 无法按照官方教程在AWS EC2上安装mongoDB