Install (and use) mongodb 3.4.17 on ubuntu 18.04

8,986

Try this

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
sudo apt update
sudo apt install mongodb-org

It installs 3.4.18 successfully. Not the version you're asking for, but should work none the less.

Good Luck!

Share:
8,986

Related videos on Youtube

paul23
Author by

paul23

Updated on September 18, 2022

Comments

  • paul23
    paul23 over 1 year

    I need to recover/read a database created in mongo 3.14. However currently I use the ubuntu 18.04 os.

    I tried following the steps given by the official guide: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/ (just replacing 4.0 with 3.4)

    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
    echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
    sudo apt-get install -y mongodb-org=3.4.17 mongodb-org-server=3.4.17 mongodb-org-shell=3.4.17 mongodb-org-mongos=3.4.17 mongodb-org-tools=3.4.17
    

    However the install fails on that last command giving the errors:

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Version '3.4.16' for 'mongodb-org' was not found
    E: Version '3.4.16' for 'mongodb-org-server' was not found
    E: Version '3.4.16' for 'mongodb-org-shell' was not found
    E: Version '3.4.16' for 'mongodb-org-mongos' was not found
    E: Version '3.4.16' for 'mongodb-org-tools' was not found
    

    (sudo apt update doesn't help).

    Now when I tried to install the files manually from the tar ball I also can't seem to find the correct version here:

    3.4.17 doesn't seem to have any ubuntu 18 support.

    As a final option, reading the database with a 4.x version also doesn't seem to work, as 4.x complains that the data has to be converted first to "3.6 format".

    Is there any way I can read a database written in 3.4 using ubuntu 18?