Gurbakhshish Singh
Gurbakhshish Singh

Reputation: 1064

Upgraded MongoDb to 3.4.3 but mongod --version still shows 3.2.1

I have upgraded my MongoDB community version to 3.4.3

When i run sudo apt-get install -y mongodb-org

i get

Reading package lists... Done
Building dependency tree
Reading state information... Done
mongodb-org is already the newest version (3.4.3).

but when i run mongod --version

i get

db version v3.2.11
git version: 009580ad490190ba33d1c6253ebd8d91808923e4
OpenSSL version: OpenSSL 1.0.2g  1 Mar 2016
allocator: tcmalloc
modules: none
build environment:
    distmod: ubuntu1604
    distarch: x86_64
    target_arch: x86_64

Edit

I ran apt-file list mongodb-server and I got result

Update(Temp Solution)

I decided to download v3.4.3 binaries using tarball

mkdir ~/bin && cd ~/bin
curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.4.3.tgz
tar -zxvf mongodb-linux-x86_64-3.4.3.tgz
mv ./mongodb-linux-x86_64-3.4.3 ./mongodb
rm mongodb-linux-x86_64-3.4.3.tgz

updated the mongod.service file by replacing /usr/bin/mongod to ~/bin/mongodb/bin/mongod

reloaded the systemctl daemon and restarted the service

Upvotes: 0

Views: 915

Answers (2)

i think this isn't a oficial solution, but i did have the same problem yesterday, and i solved this running this

  1. sudo apt-get install -y mongodb ( this go back to the db version v2.6.10 )
  2. sudo apt-get install -y mongodb-org ( and this really install db version v3.4.3 )

and restart the service (sudo service mongod restart)

i hope this can help you!

Regards

Upvotes: 1

Alex Blex
Alex Blex

Reputation: 37048

Check your sources.lists where you get mongodb-server from. The official package mongodb-org should be from http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse.

Backup your configs, and force reinstall: sudo apt-get --reinstall install -y mongodb-org

Upvotes: 0

Related Questions