Sample Header Ad - 728x90

Unable to install MongoDB on Linux Mint

1 vote
3 answers
2165 views
I cannot install MongoDB on my Linux Mint. Operating System: Linux Mint 19.1 Kernel: Linux 4.15.0-50-generic Architecture: x86-64 I followed official documentation. Import the public key used by the package management system
$ wget -qO - https://www.mongodb.org/static/pgp/server-4.0.asc  | sudo apt-key add -
Create a list file for MongoDB Ubuntu 18.04 (Bionic)
$ echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu  bionic/mongodb-org/4.0 multiverse" |
                    sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
Reload local package
$ sudo apt-get update
Install the MongoDB package
$ sudo apt-get install -y mongodb-org
While installing got these errors: Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: icoutils libboost-program-options1.65.1 libgoogle-perftools4 libpcrecpp0v5 libtcmalloc-minimal4 libwine-development libwxgtk3.0-gtk3-0v5 libyaml-cpp0.5v5 mongodb-server-core python-wxgtk3.0 python-wxversion wine64-development Use 'sudo apt autoremove' to remove them. The following additional packages will be installed: mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools The following NEW packages will be installed: mongodb-org mongodb-org-mongos mongodb-org-server mongodb-org-shell mongodb-org-tools 0 upgraded, 5 newly installed, 0 to remove and 245 not upgraded. Need to get 48.3 MB/73.0 MB of archives. After this operation, 267 MB of additional disk space will be used. Get:1 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0/multiverse amd64 mongodb-org-shell amd64 4.0.12 [9,865 kB] Get:2 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0/multiverse amd64 mongodb-org-tools amd64 4.0.12 [38.5 MB] Get:3 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0/multiverse amd64 mongodb-org amd64 4.0.12 [3,528 B] Fetched 48.3 MB in 31s (1,553 kB/s) Selecting previously unselected package mongodb-org-shell. (Reading database ... 349983 files and directories currently installed.) Preparing to unpack .../mongodb-org-shell_4.0.12_amd64.deb ... Unpacking mongodb-org-shell (4.0.12) ... Preparing to unpack .../mongodb-org-server_4.0.12_amd64.deb ... Unpacking mongodb-org-server (4.0.12) ... dpkg: error processing archive /var/cache/apt/archives/mongodb-org-server_4.0.12_amd64.deb (--unpack): trying to overwrite '/usr/bin/mongod', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1.1 dpkg-deb: error: paste subprocess was killed by signal (Broken pipe) Preparing to unpack .../mongodb-org-mongos_4.0.12_amd64.deb ... Unpacking mongodb-org-mongos (4.0.12) ... dpkg: error processing archive /var/cache/apt/archives/mongodb-org-mongos_4.0.12_amd64.deb (--unpack): trying to overwrite '/usr/bin/mongos', which is also in package mongodb-server-core 1:3.6.3-0ubuntu1.1 dpkg-deb: error: paste subprocess was killed by signal (Broken pipe) Selecting previously unselected package mongodb-org-tools. Preparing to unpack .../mongodb-org-tools_4.0.12_amd64.deb ... Unpacking mongodb-org-tools (4.0.12) ... Selecting previously unselected package mongodb-org. Preparing to unpack .../mongodb-org_4.0.12_amd64.deb ... Unpacking mongodb-org (4.0.12) ... Errors were encountered while processing: /var/cache/apt/archives/mongodb-org-server_4.0.12_amd64.deb /var/cache/apt/archives/mongodb-org-mongos_4.0.12_amd64.deb E: Sub-process /usr/bin/dpkg returned an error code (1) Tried to start the DB
$ sudo service mongod start

Failed to start mongod.service: Unit mongod.service not found.
The command below gives the same error:
sudo apt-get install -f
Unable to remove mongodb-server-core: $ apt remove mongodb-server-core Reading package lists... Done Building dependency tree Reading state information... Done You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: mongodb-org : Depends: mongodb-org-server but it is not going to be installed Depends: mongodb-org-mongos but it is not going to be installed E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
Asked by VA splash (153 rep)
Aug 11, 2019, 05:03 PM
Last activity: Jul 20, 2025, 08:07 PM