sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.4.list
sudo apt-get update
sudo apt-get install -y mongodb-org
#if it creates this file, delete it
sudo rm /etc/systemd/system/mongodb.service
sudo nano /etc/systemd/system/mongodb.service
#Append the contents of mongodb.service file below
#if it creates this file, delete it
sudo rm /etc/mongod.conf
sudo nano /etc/mongod.conf
#Append the contents of mongod.conf file below
#Start your system
sudo systemctl start mongodb
#If service is masked, unmask it
sudo systemctl unmask mongodb
#check status
sudo systemctl status mongodb
#Enable automatic load
sudo systemctl enable mongodb
#Start MongoDB
sudo systemctl start mongodb