Add MongoDB Repository

MongoDB Inc releases stable packages for Ubuntu operating systems and shares them via their repository. MongoDB packages available in MongoDB repository are generally fresher than those in the Ubuntu repositories.

You should always use the official MongoDB packages.

Install the below dependent packages.

sudo apt update

sudo apt install -y gnupg

Add the MongoDB’s official repository to the system.

wget -qO - https://www.mongodb.org/static/pgp/server-4.4.asc | sudo apt-key add -

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

Install MongoDB

Update the repository index.

sudo apt update

Install the MongoDB using the [apt](https://www.itzgeek.com/how-tos/linux/18-useful-apt-apt-get-and-apt-cache-command-examples-for-package-management.html) command.

sudo apt install -y mongodb-org

#ubuntu #mongodb #ubuntu 20.04

How To Install MongoDB On Ubuntu 20.04
1.45 GEEK