E: Unable to locate package mongodb-org

I am new to MongoDB and I am trying to install it in Ubuntu 18.04. I am following the instructions for installation and the command ‘sudo apt-get install -y mongodb-org’ is giving the following result.

Reading package lists… Done
Building dependency tree
Reading state information… Done
E: Unable to locate package mongodb-org

After adding the repo did the apt-get update complete successfully ?

It should look similar to the below, specifically the lines with repo.mongodb.org

apt-get update
Ign:1 http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 InRelease
Get:2 http://archive.ubuntu.com/ubuntu bionic InRelease [242 kB]
Get:3 http://security.ubuntu.com/ubuntu bionic-security InRelease [88.7 kB]
Get:4 http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 Release [5391 B]          
Get:5 http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 Release.gpg [801 B]               
Get:6 http://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4/multiverse amd64 Packages [7139 B]    
Get:7 http://security.ubuntu.com/ubuntu bionic-security/restricted amd64 Packages [237 kB]
Get:8 http://archive.ubuntu.com/ubuntu bionic-updates InRelease [88.7 kB]       
Get:9 http://archive.ubuntu.com/ubuntu bionic-backports InRelease [74.6 kB]        
Get:10 http://archive.ubuntu.com/ubuntu bionic/multiverse amd64 Packages [186 kB]           
Get:11 http://security.ubuntu.com/ubuntu bionic-security/multiverse amd64 Packages [15.3 kB]
Get:12 http://security.ubuntu.com/ubuntu bionic-security/main amd64 Packages [1816 kB]
Get:13 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages [11.3 MB]            
Get:14 http://security.ubuntu.com/ubuntu bionic-security/universe amd64 Packages [1372 kB] 
Get:15 http://archive.ubuntu.com/ubuntu bionic/main amd64 Packages [1344 kB]                  
Get:16 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages [13.5 kB]                                                                                   
Get:17 http://archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 Packages [53.8 kB]                                                                           
Get:18 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 Packages [2244 kB]                                                                                 
Get:19 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 Packages [2136 kB]                                                                             
Get:20 http://archive.ubuntu.com/ubuntu bionic-updates/restricted amd64 Packages [266 kB]                                                                            
Get:21 http://archive.ubuntu.com/ubuntu bionic-backports/main amd64 Packages [11.3 kB]                                                                               
Get:22 http://archive.ubuntu.com/ubuntu bionic-backports/universe amd64 Packages [11.4 kB]                                                                           
Fetched 21.6 MB in 8s (2606 kB/s)                                                                                                                                    
Reading package lists... Done

Double check the list file was created sucessfully:
cat /etc/apt/sources.list.d/mongodb-org-4.4.list

Output should look like:
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse

1 Like

@chris hello,

i have everything right, but i get this error :
E: Unable to locate package mongodb-org

my ubuntu version is :
# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.5 LTS
Release: 18.04
Codename: bionic

liste file is :
# cat /etc/apt/sources.list.d/mongodb-org-4.4.list
deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.4 multiverse