英文:
Mongodb stuck at version 5
问题
我已经在我的Amazon EC2上运行了MongoDB 4版本一段时间,使用Amazon Linux 2013。然后,我成功地按照文档更新了MongoDB到版本5:https://www.mongodb.com/docs/v5.0/tutorial/install-mongodb-on-amazon/
通过添加repo文件,运行"sudo yum update"会自动更新MongoDB。
然后,我对MongoDB 6执行了相同的步骤:https://www.mongodb.com/docs/v6.0/tutorial/install-mongodb-on-amazon/
我添加了一个repo文件,位于etc/yum.repos.d/mongodb-org-6.0.repo,内容如下:
[mongodb-org-6.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/6.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-6.0.asc
然后,我运行了以下命令:
sudo yum install -y mongodb-org
但我得到了以下错误:
amzn-main | 2.1 kB 00:00:00
amzn-updates | 3.8 kB 00:00:00
mongodb-org-3.4 | 2.5 kB 00:00:00
mongodb-org-3.6 | 2.5 kB 00:00:00
mongodb-org-4.0 | 2.5 kB 00:00:00
mongodb-org-4.2 | 1.3 kB 00:00:00
mongodb-org-4.4 | 1.3 kB 00:00:00
mongodb-org-5.0 | 1.3 kB 00:00:00
mongodb-org-6.0 | 1.3 kB 00:00:00
Package mongodb-org-5.0.15-1.amzn1.x86_64 already installed and latest version
Nothing to do
这可能是为什么它找不到MongoDB 6版本并认为版本5是最新版本的原因?
如果我尝试强制安装版本6,我也会看到相同的问题:
sudo yum install -y mongodb-org-6.0.4 mongodb-org-database-6.0.4 mongodb-org-server-6.0.4 mongodb-org-mongos-6.0.4 mongodb-org-tools-6.0.4
Loaded plugins: priorities, update-motd, upgrade-helper
Repository mongodb-org-3.6 is listed more than once in the configuration
amzn-main | 2.1 kB 00:00:00
amzn-updates | 3.8 kB 00:00:00
No package mongodb-org-6.0.4 available.
No package mongodb-org-database-6.0.4 available.
No package mongodb-org-server-6.0.4 available.
No package mongodb-org-mongos-6.0.4 available.
No package mongodb-org-tools-6.0.4 available.
Error: Nothing to do
英文:
I have been running a mongodb version 4 for a while on my amazon ec2 with amazon linux 2013. I have then successfully updated MongoDB to version 5 by following the documentation:
https://www.mongodb.com/docs/v5.0/tutorial/install-mongodb-on-amazon/
By adding the repo file, sudo yum update will automatically update MongoDB.
I then did the same with MongoDB 6:
https://www.mongodb.com/docs/v6.0/tutorial/install-mongodb-on-amazon/
I added a repo file etc/yum.repos.d/mongodb-org-6.0.repo with the content
[mongodb-org-6.0]
name=MongoDB Repository
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/6.0/x86_64/
gpgcheck=1
enabled=1
gpgkey=https://www.mongodb.org/static/pgp/server-6.0.asc
I then run
sudo yum install -y mongodb-org
But I get
amzn-main | 2.1 kB 00:00:00
amzn-updates | 3.8 kB 00:00:00
mongodb-org-3.4 | 2.5 kB 00:00:00
mongodb-org-3.6 | 2.5 kB 00:00:00
mongodb-org-4.0 | 2.5 kB 00:00:00
mongodb-org-4.2 | 1.3 kB 00:00:00
mongodb-org-4.4 | 1.3 kB 00:00:00
mongodb-org-5.0 | 1.3 kB 00:00:00
mongodb-org-6.0 | 1.3 kB 00:00:00
Package mongodb-org-5.0.15-1.amzn1.x86_64 already installed and latest version
Nothing to do
What could be the reason it doesn't find any version 6 of MongoDB and thinks version 5 is the latest?
I also see the same issue if I try to force install version 6:
sudo yum install -y mongodb-org-6.0.4 mongodb-org-database-6.0.4 mongodb-org-server-6.0.4 mongodb-org-mongos-6.0.4 mongodb-org-tools-6.0.4
Loaded plugins: priorities, update-motd, upgrade-helper
Repository mongodb-org-3.6 is listed more than once in the configuration
amzn-main | 2.1 kB 00:00:00
amzn-updates | 3.8 kB 00:00:00
No package mongodb-org-6.0.4 available.
No package mongodb-org-database-6.0.4 available.
No package mongodb-org-server-6.0.4 available.
No package mongodb-org-mongos-6.0.4 available.
No package mongodb-org-tools-6.0.4 available.
Error: Nothing to do
答案1
得分: 1
他们在回答时不提供v6主机。如果你现在打开这个URL,只有mongosh和db工具。
这可能是文档不及时更新的罕见情况,但领先于日期 =)
如果你感到冒险,你可以尝试从测试仓库中获取v6.0.0.rc1的候选版本:
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/testing/x86_64/
英文:
They don't host v6 there at the time of answering. If you open the url now it's only mongosh and db tools there.
Must be a rare case when documentation is not up-to-date, but ahead-the-date =)
If you feel adventurous, you can try a release candidate v6.0.0.rc1 from testing repo:
baseurl=https://repo.mongodb.org/yum/amazon/2013.03/mongodb-org/testing/x86_64/
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论