4

I posted about this before at unable to install mongodb on ubuntu 14.04 but that question didn't have me installing from the mongodb repos. I could edit that question, I suppose, but that'd kinda invalidate the answer that was given and plus since it's not a new question anymore it likely wouldn't be noticed.

Anyway, I'm trying to install MongoDB on Ubuntu 15.04 and can't. I did the following:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
echo "deb http://repo.mongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get update
sudo apt-get install -y mongodb-org

sudo apt-get update returned the following:

Ign http://repo.mongodb.org vivid/mongodb-org/3.0 InRelease
Ign http://archive.ubuntu.com vivid InRelease
Ign http://security.ubuntu.com vivid-security InRelease
Ign http://repo.mongodb.org vivid/mongodb-org/3.0 Release.gpg
Ign http://archive.ubuntu.com vivid-updates InRelease
Get:1 http://security.ubuntu.com vivid-security Release.gpg [933 B]
Get:2 http://archive.ubuntu.com vivid Release.gpg [933 B]
Get:3 http://security.ubuntu.com vivid-security Release [63.5 kB]
Ign http://repo.mongodb.org vivid/mongodb-org/3.0 Release
Get:4 http://archive.ubuntu.com vivid-updates Release.gpg [933 B]
Get:5 http://archive.ubuntu.com vivid Release [217 kB]
Get:6 http://security.ubuntu.com vivid-security/main amd64 Packages [99.8 kB]
Get:7 http://security.ubuntu.com vivid-security/restricted amd64 Packages [28 B]
Get:8 http://security.ubuntu.com vivid-security/main Translation-en [52.7 kB]
Get:9 http://archive.ubuntu.com vivid-updates Release [63.5 kB]
Get:10 http://security.ubuntu.com vivid-security/restricted Translation-en [14 B]
Get:11 http://archive.ubuntu.com vivid/main amd64 Packages [1,364 kB]
Err http://repo.mongodb.org vivid/mongodb-org/3.0/multiverse amd64 Packages
  404  Not Found
Ign http://repo.mongodb.org vivid/mongodb-org/3.0/multiverse Translation-en_US
Ign http://repo.mongodb.org vivid/mongodb-org/3.0/multiverse Translation-en
Get:12 http://archive.ubuntu.com vivid/restricted amd64 Packages [15.4 kB]
Get:13 http://archive.ubuntu.com vivid/main Translation-en [793 kB]
Hit http://archive.ubuntu.com vivid/restricted Translation-en
Get:14 http://archive.ubuntu.com vivid-updates/main amd64 Packages [171 kB]
Get:15 http://archive.ubuntu.com vivid-updates/restricted amd64 Packages [28 B]
Get:16 http://archive.ubuntu.com vivid-updates/main Translation-en [83.3 kB]
Get:17 http://archive.ubuntu.com vivid-updates/restricted Translation-en [14 B]
Fetched 2,926 kB in 4s (713 kB/s)
W: Failed to fetch http://repo.mongodb.org/apt/ubuntu/dists/vivid/mongodb-org/3.0/multiverse/binary-amd64/Packages  404  Not Found

E: Some index files failed to download. They have been ignored, or old ones used instead.

Note the 404 Not Found errors.

Anyway, I try sudo apt-get install -y mongodb-org after that and the output I get is as follows:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mongodb-org

Any ideas?

neubert
  • 211
  • 1
  • 8
  • 15
  • First off, since you are using the solutions provided by @A.B. to http://askubuntu.com/q/657113/180177 I think you should accept his post as the answer to your previous question. In addition, there is no package for 15.04 in that repo, so follow the suggestions http://askubuntu.com/questions/636119/how-do-i-install-mongodb-3-0-in-vivid – Ron Aug 09 '15 at 07:54
  • actually, the answer in the last question did have you installing from the mongodb repo but that won't work here as there is no repo for 15.04; you have to install using the debian wheezy repo – mchid Aug 09 '15 at 10:34

1 Answers1

4

On 15.04 you have to install the debian wheezy version because of systemd. Run the following commands:

sudo rm /etc/init.d/mongod*
sudo rm /etc/apt/sources.list.d/mongo*
sudo apt-get purge mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools syslog-ng-mod-mongodb
echo "deb http://repo.mongodb.org/apt/debian wheezy/mongodb-org/3.0 main" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
sudo apt-get clean
sudo apt-get update
sudo apt-get install mongodb-org
sudo service mongod start
systemctl status mongod

Ignore any "not found" or "unable to locate" errors on the first three commands.

mchid
  • 43,546
  • 8
  • 97
  • 150