0

I am following https://docs.mongodb.com/manual/tutorial/install-mongodb-on-ubuntu/#install-mongodb-community-edition to install mongodb on Lubuntu 18.04

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

The second command has xenial, and do I need to change it to bionic?

Why in my following experiment with the change, it doesn't work?

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

$ sudo apt-get update
Get:1 http://security.ubuntu.com/ubuntu bionic-security InRelease [83.2 kB]
Ign:2 http://ppa.launchpad.net/adrozdoff/emacs/ubuntu bionic InRelease                                                                                                           
Ign:3 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                                                     
Hit:4 http://us.archive.ubuntu.com/ubuntu bionic InRelease                                                                                                                       
Get:5 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]                                                                                                     
Err:6 http://ppa.launchpad.net/adrozdoff/emacs/ubuntu bionic Release                                                                                                             
  404  Not Found [IP: 91.189.95.83 80]
Hit:7 http://dl.google.com/linux/chrome/deb stable Release                                                                                                                       
Hit:8 https://dl.winehq.org/wine-builds/ubuntu bionic InRelease                                                                                                                  
Get:9 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]                                                          
Hit:10 http://repo.mysql.com/apt/ubuntu bionic InRelease                                                                              
Ign:11 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 InRelease                        
Err:12 https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 Release    
  404  Not Found [IP: 54.230.36.150 443]
Get:14 http://security.ubuntu.com/ubuntu bionic-security/main amd64 DEP-11 Metadata [204 B]
Get:15 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 DEP-11 Metadata [2,452 B]
Get:16 http://us.archive.ubuntu.com/ubuntu bionic-updates/main amd64 DEP-11 Metadata [138 kB]
Get:17 http://us.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 48x48 Icons [31.4 kB]
Get:18 http://us.archive.ubuntu.com/ubuntu bionic-updates/main DEP-11 64x64 Icons [53.7 kB]      
Get:19 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe amd64 DEP-11 Metadata [125 kB]
Get:20 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 48x48 Icons [126 kB]  
Get:21 http://us.archive.ubuntu.com/ubuntu bionic-updates/universe DEP-11 64x64 Icons [212 kB]   
Get:22 http://us.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 DEP-11 Metadata [2,468 B]
Get:23 http://us.archive.ubuntu.com/ubuntu bionic-backports/universe amd64 DEP-11 Metadata [5,100 B]

Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/adrozdoff/emacs/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: The repository 'https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

Why in my following experiment without the change, it works?

$ sudo apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package mongodb-org

$ 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
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse

$ sudo apt-get update
Hit:1 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Ign:2 http://dl.google.com/linux/chrome/deb stable InRelease                                                                                                                     
Hit:3 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease                                                                                                               
Hit:4 http://us.archive.ubuntu.com/ubuntu bionic-backports InRelease                                                                                                             
Ign:5 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 InRelease                                                                                                       
Ign:6 http://ppa.launchpad.net/adrozdoff/emacs/ubuntu bionic InRelease                                                                                                           
Hit:7 http://dl.google.com/linux/chrome/deb stable Release                                                                                                 
Hit:8 http://security.ubuntu.com/ubuntu bionic-security InRelease                                                                                                                
Hit:9 http://repo.mysql.com/apt/ubuntu bionic InRelease                                                                                                                          
Get:10 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 Release [3,457 B]                                                                                              
Hit:11 https://dl.winehq.org/wine-builds/ubuntu bionic InRelease                                                                                 
Get:12 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 Release.gpg [801 B]           
Err:13 http://ppa.launchpad.net/adrozdoff/emacs/ubuntu bionic Release               
  404  Not Found [IP: 91.189.95.83 80]
Get:15 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0/multiverse arm64 Packages [2,146 B]
Get:16 https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0/multiverse amd64 Packages [2,143 B]
Reading package lists... Done
E: The repository 'http://ppa.launchpad.net/adrozdoff/emacs/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

$ sudo apt-get install -y mongodb-org
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 mongodb-org : Depends: mongodb-org-server but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
1

MongoDB has not setup repo for bionic at this time, only for xenial. That's why if you change the repo to point to bionic, there is nothing there.

Many xenial repo may work with bionic as many libraries and dependencies are flxible and are able to function in the new updated Ubuntu environment. Keep using the xenial repo unless you run into incompatibility iesues. Once MongoDB releases the repo for bionic, you can then switch over.

  • Thanks. When the bionic version is available, to switch over, do I only need to run echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse, without uninstalling mongodb, and run sudo apt update; sudo apt upgrade? – Tim Jul 17 '18 at 22:22
  • 1
    Normally I would remove the mongodb from one repo before switching over. It should keep the user data alone unless you use purge instead of remove. Do apt remove first, switch to the new repo, do the apt update then install the mongodb from the new repo. – Bernard Wei Jul 17 '18 at 22:28
  • Why would you remove it? without removing it, will it be upgraded after changing xenial to bionic in the repo? – Tim Jul 17 '18 at 22:29
  • The danger of leaving packages around is that you might run into situation like this one, askubuntu.com/questions/1054292/… – Bernard Wei Jul 17 '18 at 22:30
  • Do you mean I will have two versions of Mongodb installed? – Tim Jul 17 '18 at 22:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.