1

我的 mongodb 安装不是很好。我在 /etc/apt/sources.list 中添加了一个位置,但我收到一条错误消息,指出 i386 包和 amd64 包之间的条目中有重复项?我尝试了更新,但它不起作用。

4

4 回答 4

3

在这个how-to-install-mongodb-on-ubuntu中,每个步骤都得到了很好的解释。我试过了,它按预期进行。祝你好运!:)

于 2014-02-09T02:59:28.520 回答
2

在 ubuntu 中安装 mongodb 很容易。

第 1 步:搜索可用的 mongodb 包,但最初它可能不存在

sudo apt-cache search mongodb

第 2 步:将包添加到,/etc/apt/sources.list.d因为它是最新的稳定 MongoDB 版本

vim /etc/apt/sources.list.d/mongodb.list

将以下链接添加到 mongodb.list 文件中

deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen

第 3 步:导入 GPG 密钥

apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10

第 4 步:使用以下命令更新 debian 软件包:

apt-get update

第 5 步:现在执行搜索以查看包

apt-cache search mongodb

第 6 步:现在软件包将出现,因此使用以下命令安装它:

apt-get install mongodb-10gen

第 7 步:检查 mongodb 是否已开始使用

ps -ef | grep mongo
ls -ls /usr/bin | grep mongo

第 8 步:在 /etc/init.d/mongodb 生成 mongodb 控制脚本,MongoDB 配置文件在 /etc/mongodb.conf 添加以下详细信息:

verbose = true
dbpath = /data/db
logpath = /var/log/mongodb.log
logappend = true
port = 27017

第 9 步:将 mongodb 作为服务启动

service mongodb start

第10步:检查mongodb服务是否已开始使用

ps -ef | grep mongodb

第 11 步:要停止/重新启动,请执行以下命令:

service mongodb stop
service mongodb restart

这是从我的博客文章中摘录的,我已经对此进行了更详细的解释。

于 2015-02-19T12:28:22.593 回答
0

Download and Unzip the .tar .zip and invoke in terminal $.\mongod (after unzip, it runs server instance on default port), Use another terminal and try $.\mongo (show dbs, use dbname, show collections,...)

Depending on the 32bit/64bit version depending on your system capability use 32/64 bit.

于 2013-10-19T05:47:15.617 回答
-1
first you have to configure Ubuntu Package Management System (APT)
to be able to get the public GPG key

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10 
or type
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

another issue you may face it's when you want to connect
to the internet through proxy, export proxy settings to you bash configuration
- add this line with your proxy address (at the end of file /etc/bash.bashrc):

export http_proxy=http://username:password@proxyserver:port/ 

now Create a /etc/apt/sources.list.d/10gen.list file and include 
the following line in the 10gen.list for the 10gen repository:

deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen

if you get that went right you have to update the packages
sudo apt-get update

now install mongodb package:
sudo apt-get install mongodb-10gen

and you good !!!
于 2013-10-19T06:00:26.830 回答