2013-12-10 64 views
4

在Ubuntu上按照網站上的分步說明安裝MongoDb http://docs.mongodb.org/manual/tutorial/install-mongodb-on-linux/ 當我嘗試運行mongo時收到以下錯誤。 「程序'mongo'目前沒有安裝。」在Ubuntu上安裝了MongoDb,表示未安裝

然而它在目錄中。

[email protected]:~$ mkdir -p mongodb 
[email protected]:~$ ls 

mongodb  mongodb-linux-x86_64-2.5.4.tgz 

[email protected]:~$ cp -R -n mongodb-linux-x86_64-2.5.4/ mongodb 
[email protected]:~$ cd mongodb 
[email protected]:~/mongodb$ ls 

mongodb-linux-x86_64-2.5.4 

[email protected]:~/mongodb$ cd mongodb-linux-x86_64-2.5.4/ 
[email protected]:~/mongodb/mongodb-linux-x86_64-2.5.4$ ls 

bin GNU-AGPL-3.0 README THIRD-PARTY-NOTICES 

[email protected]:~/mongodb/mongodb-linux-x86_64-2.5.4$ cd bin/ 
[email protected]:~/mongodb/mongodb-linux-x86_64-2.5.4/bin$ ls 

bsondump mongodump mongoimport mongorestore mongotop 
mongo  mongoexport mongooplog mongos 
mongod mongofiles mongoperf mongostat 

[email protected]:~/mongodb/mongodb-linux-x86_64-2.5.4/bin$ mongo 

The program 'mongo' is currently not installed. You can install it by typing: 
sudo apt-get install mongodb-clients 

[email protected]:~/mongodb/mongodb-linux-x86_64-2.5.4/bin$ 

回答

2

看到安裝MongoDB的首選方式,所有它在10gen installation doc對Ubuntu的依賴,增加10gen的MongoDB的公共GPG密鑰:

sudo apt-get install mongodb-10gen 
+0

但它不支持32位。 – Abel

4

它說,它沒有安裝,因爲:

[email protected]:~/mongodb/mongodb-linux-x86_64-2.5.4/bin$ mongo 

使shell搜索OS $PATH以查找匹配的程序。既然你從互聯網上下載並提取其實際需要:

[email protected]:~/mongodb/mongodb-linux-x86_64-2.5.4/bin$ ./mongo 

所以它搜索的程序的當前目錄。或者你可以將它添加到$PATH如果你想。

我不確定官方回購是否有不穩定的版本,如奇數版本所示,即2.5.x