问题描述
我有点像外壳n00b.
Hi I'm a bit of a shell n00b.
谁能告诉我如何检查Linux Ubuntu计算机上安装的MongoDB版本?
Can anyone tell me how I would check the version of MongoDB that is installed on my Linux Ubuntu machine?
我看到我的MongoDB Shell版本:1.2.2,所以我很确定MongoDB本身也已经过时了.有人知道如何更新MongoDB"文档吗?我发现mongodb.org有点令人困惑.
I see that my MongoDB shell version: 1.2.2 so Im pretty sure that MongoDB itself is out dated too. And does anyone know of any 'How to update MongoDB' docs? I find mongodb.org to be a bit confusing.
请谢谢.
好吧,如果我在mongo shell中使用db.version()它说1.2.2
Ok if I use db.version() inside of mongo shell it says 1.2.2
如果我$ mongod --version我会得到:
If I $ mongod --version I get this:
db version v1.2.2, pdfile version 4.5
Wed Oct 16 10:28:22 git version: nogitversion
我跑了
sudo apt-get update
sudo apt-get install mongodb
并获得
sudo apt-get install mongodb
Reading package lists... Done
Building dependency tree
Reading state information... Done
mongodb is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 179 not upgraded.
mongod --version
db version v1.2.2, pdfile version 4.5
Wed Oct 16 10:31:07 git version: nogitversion
那为什么不更新呢? apt-get是否指向错误的回购/来源?
So why isn't it updating? Is apt-get pointing at the wrong repo / source?
推荐答案
答案:阅读说明#dua
ANSWER: Read the instructions #dua
好吧,我显然在安装时错过了这一行:
Ok the magic was in this line that I apparently missed when installing was:
$ sudo apt-get install mongodb-10gen=2.4.6
以及此处所述的完整过程 http://docs.mongodb.org/manual /tutorial/install-mongodb-on-ubuntu/是
And the full process as described here http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/ is
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
$ echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list
$ sudo apt-get update
$ sudo apt-get install mongodb-10gen
$ sudo apt-get install mongodb-10gen=2.2.3
$ echo "mongodb-10gen hold" | sudo dpkg --set-selections
$ sudo service mongodb start
$ mongod --version
db version v2.4.6
Wed Oct 16 12:21:39.938 git version: b9925db5eac369d77a3a5f5d98a145eaaacd9673
重要提示:请确保将2.4.6更改为最新版本(或要安装的任何版本).在此处 http://www.mongodb.org/downloads
IMPORTANT: Make sure you change 2.4.6 to the latest version (or whatever you want to install). Find the latest version number here http://www.mongodb.org/downloads
这篇关于Ubuntu上安装了什么版本的MongoDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!