简体   繁体   中英

Mongodb 4.0.4 installation error in Linux

I am using 16.04.1-Ubuntu SMP i686 athlon i686 GNU/Linux (LINUX Mint)

I followed [offical documentation][1], but end up in errors.

installation using LATEST VERSION OF MongoDB

$ sudo apt-get install -y mongodb-org

Errors

Package mongodb-org is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'mongodb-org' has no installation candidate

Installation using Specific release of Mongodb

$sudo apt-get install -y mongodb-org=4.0.4 mongodb-org-server=4.0.4 mongodb-org-shell=4.0.4 mongodb-org-mongos=4.0.4 mongodb-org-tools=4.0.4

Error

E: Version '4.0.4' for 'mongodb-org' was not found
E: Version '4.0.4' for 'mongodb-org-server' was not found
E: Version '4.0.4' for 'mongodb-org-shell' was not found
E: Version '4.0.4' for 'mongodb-org-mongos' was not found
E: Version '4.0.4' for 'mongodb-org-tools' was not found

Note : the above installation is done after executing these codes

$sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
$echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
$sudo apt-get update

Tutorial: https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list

sudo apt-get update

sudo apt-get install -y mongodb-org

sudo service mongod start
$sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
$echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
$sudo apt-get update

Note that you have ubuntu trusty in the .list file, but you stated that you are running Ubuntu 16.04 . The installation documentation has tabs for the supported Ubuntu releases. For example, clicking on the tab for Ubuntu 16.04 provides the following:

echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list

You may need to remove the old .list file and start from scratch to remove any potential conflicts. So sudo rm /etc/apt/sources.list.d/mongodb-org-4.0.list .

Then repeat the installation steps, making sure to select the correct tab for your Ubuntu version. You can cat /etc/apt/sources.list.d/mongodb-org-4.0.list to double check everything matches up.

I've validated our installation instructions on Ubuntu 16.04 in VM as recently as last week, so we should be able to get you up and running here.

You state:

I am using 16.04.1-Ubuntu SMP i686 athlon **i686** GNU/Linux (LINUX Mint)

Your system is 32bit .

Yet you are trying to install amd64 (64bit) sources/packages:

$echo "deb [ **arch=amd64** ] https://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list

This won't work.

Solution: Install Ubuntu 64bit.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM