If you already have installed the mongodb and you remove it make sure your run this command : First, remove any existing repository file for MongoDB.
sudo rm /etc/apt/sources.list.d/mongodb*.list
Step 1 – Setup Apt Repository
First of all, import MongoDB public GPG key in your system by issuing the following command. This key ensures package consistency and authenticity.
Lets add MongoDB APT repository url in /etc/apt/sources.list.d/mongodb.list.
Step 2 – Install MongoDB Server
After adding required APT repositories, use the following commands to install MongoDB on your systems. It will also install all dependent packages required for MongoDB.
Post a Comment