Reputation: 222811
I am running ubuntu and have Mongo 2.6.0 installed.
Recently a new minor version of Mongo appeared (2.6.2), but for some reason I can not upgrade to it with apt-get update && apt-get upgrade
(which I remember correctly upgraded minor versions when I was on 2.4.x version).
I assume that I can remove mongo and reinstall it, but this does not sound appealing.
Also I know that this question is not programming per se, but I think it will be useful for other people and also SO has a good mongo-community. (But if someone finds it really off-topic, please move it)
Here is the actual output:
ubuntu@ip-10-34-23-80:~$ sudo apt-get update && sudo apt-get upgrade
Ign http://eu-west-1.ec2.archive.ubuntu.com trusty InRelease
Ign http://eu-west-1.ec2.archive.ubuntu.com trusty-updates InRelease
Hit http://eu-west-1.ec2.archive.ubuntu.com trusty Release.gpg
Hit http://eu-west-1.ec2.archive.ubuntu.com trusty-updates Release.gpg
Hit http://eu-west-1.ec2.archive.ubuntu.com trusty Release
Hit http://eu-west-1.ec2.archive.ubuntu.com trusty-updates Release
Hit http://eu-west-1.ec2.archive.ubuntu.com trusty/main Sources
Hit http://eu-west-1.ec2.archive.ubuntu.com trusty/universe Sources
Hit http://eu-west-1.ec2.archive.ubuntu.com trusty/main amd64 Packages
Hit http://eu-west-1.ec2.archive.ubuntu.com trusty/universe amd64 Packages
Hit http://eu-west-1.ec2.archive.ubuntu.com trusty-updates/main Sources
Hit http://eu-west-1.ec2.archive.ubuntu.com trusty-updates/universe Sources
Hit http://eu-west-1.ec2.archive.ubuntu.com trusty-updates/main amd64 Packages
Hit http://eu-west-1.ec2.archive.ubuntu.com trusty-updates/universe amd64 Packages
Ign http://security.ubuntu.com trusty-security InRelease
Get:1 http://security.ubuntu.com trusty-security Release.gpg [933 B]
Ign http://eu-west-1.ec2.archive.ubuntu.com trusty/main Translation-en_US
Ign http://eu-west-1.ec2.archive.ubuntu.com trusty/main Translation-en
Ign http://eu-west-1.ec2.archive.ubuntu.com trusty/universe Translation-en_US
Ign http://eu-west-1.ec2.archive.ubuntu.com trusty/universe Translation-en
Ign http://eu-west-1.ec2.archive.ubuntu.com trusty-updates/main Translation-en_US
Ign http://eu-west-1.ec2.archive.ubuntu.com trusty-updates/main Translation-en
Ign http://eu-west-1.ec2.archive.ubuntu.com trusty-updates/universe Translation-en_US
Ign http://eu-west-1.ec2.archive.ubuntu.com trusty-updates/universe Translation-en
Get:2 http://security.ubuntu.com trusty-security Release [58.5 kB]
Get:3 http://security.ubuntu.com trusty-security/main Sources [20.6 kB]
Get:4 http://security.ubuntu.com trusty-security/universe Sources [4,727 B]
Get:5 http://security.ubuntu.com trusty-security/main amd64 Packages [61.3 kB]
Get:6 http://security.ubuntu.com trusty-security/universe amd64 Packages [21.5 kB]
Hit http://security.ubuntu.com trusty-security/main Translation-en
Hit http://security.ubuntu.com trusty-security/universe Translation-en
Ign http://security.ubuntu.com trusty-security/main Translation-en_US
Ign http://security.ubuntu.com trusty-security/universe Translation-en_US
Fetched 168 kB in 2s (76.9 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
When I do sudo apt-cache policy mongodb-org
I see no information about 2.6.2
version.
mongodb-org:
Installed: 2.6.0
Candidate: 2.6.0
Version table:
*** 2.6.0 0
100 /var/lib/dpkg/status
Upvotes: 2
Views: 1799
Reputation: 12240
The correct command to update MongoDB to the latest version is:
sudo apt-get install mongodb-org
You can check the details about the package and it's versions with:
sudo apt-cache policy mongodb-org
It will display something like this:
mongodb-org:
Installed: 2.6.1
Candidate: 2.6.2
Version table:
2.6.2 0
500 http://downloads-distro.mongodb.org/repo/ubuntu-upstart/ dist/10gen amd64 Packages
*** 2.6.1 0
500 http://downloads-distro.mongodb.org/repo/ubuntu-upstart/ dist/10gen amd64 Packages
100 /var/lib/dpkg/status
2.6.0 0
500 http://downloads-distro.mongodb.org/repo/ubuntu-upstart/ dist/10gen amd64 Packages
The previous name of the package, from MongoDB repositories, was mongodb-10gen
but it was renamed to mongodb-org
.
If you try to install mongo
package with:
sudo apt-get install mongodb
It will try to install the MongoDB from Ubuntu repositories (which is much older).
Be sure to always check the offical installation page for updates to their repo location etc.
Edit
It seems that your package was installed manually from a deb package or the MongoDB repo was removed from the apt sources list.
Either way, adding the MongoDB repo back to sources list and then doing:
sudo apt-get update && sudo apt-get install mongodb-org
will install the newest version of the MongoDB (just for reference, link to the official installation docs).
Upvotes: 2