0

I want to install MongoDB in ubantu 12.04, but I don't have any idea to add
deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen
code in
/etc/apt/sources.list
file. I used
sudo vim /etc/apt/sources.list
for this propose. But I am unable to edit the file. Does anybody know how I can resolve this issue?

11
  • What error are you getting? What "is not a success"? As indicated by parvin, the tutorial page contains everything that you need on a step-by-step basis. Apend the line "deb downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" to the end of the /etc/apt/sources.list file. Jul 16, 2012 at 8:37
  • @MarkHillick, I can't add the deb downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen line of code in /etc/apt/sources.list file
    – Ganesh kunwar
    Jul 16, 2012 at 8:40
  • 1
    What error do you receive? Are you not in the sudoers group? Jul 16, 2012 at 8:49
  • 1
    Can you post a screenshot of your error? Or the text? It's too vague so far? What's the output of "ls -la /etc/apt/sources.list"? Jul 16, 2012 at 9:02
  • 1
    Please do what people ask you instead of repeating yourself. Jul 20, 2012 at 18:36

3 Answers 3

1

You can follow the instructions in the MongoDB tutorial page.

3
  • Those are the instructions he followed. That's where the addition of 10gen repo comes from. Jul 16, 2012 at 10:39
  • Since I don't know which instructions he followed, i suggest him to use the step by step instructions on the MongoDB page.
    – parvin
    Jul 16, 2012 at 10:44
  • He said what instructions he followed. Your answer is essentially a copy of what he did. Jul 18, 2012 at 13:40
0

here is my solution, copy following in your install_mongo.bash file

    sudo apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
    echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" | sudo tee -a /etc/apt/sources.list.d/10gen.list
    sudo apt-get update
    sudo apt-get install mongodb-10gen

and then execute bash install_mongo.bash

-1

I believe it's a file permission issue. Execute the following commands:

sudo su - 
echo "deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen" >> /etc/apt/sources.list 

That will make sure that you really executed the commands as root.

This should work, but a more clean way how to do it in Ubuntu 12.04 is to add the new repository in /etc/apt/sources.list.d/10gen.list.

Now the only think left is to install it.

apt-get update
apt-get install mongodb-10gen
2
  • Ganesh used sudo, how is this solution different? Jul 18, 2012 at 13:54
  • Double checking if he used all the commands right. I guess because he is a novice there is a chance that he missed some steps. So with my approach he will make sure that he is logged as root. If even after that he is not able to write the file we can exclude user permission problem and look for other causes. Also I added the ending step how to actually install the program and changed the location of the repo file, which is a much more widely used approach.
    – golja
    Jul 18, 2012 at 23:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .