Skip to content

Instantly share code, notes, and snippets.

@cornflourblue
Last active June 4, 2021 02:32
Show Gist options
  • Save cornflourblue/34e2e2b14979198151493cf893b0697d to your computer and use it in GitHub Desktop.
Save cornflourblue/34e2e2b14979198151493cf893b0697d to your computer and use it in GitHub Desktop.
#!/usr/bin/env bash
echo "
----------------------
MONGODB
----------------------
"
# import mongodb 4.0 public gpg key
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
# create the /etc/apt/sources.list.d/mongodb-org-4.0.list file for mongodb
echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
# reload local package database
sudo apt-get update
# install the latest version of mongodb
sudo apt-get install -y mongodb-org
# start mongodb
sudo systemctl start mongod
# set mongodb to start automatically on system startup
sudo systemctl enable mongod
@ayush11-11
Copy link

bash: line 1: 404:: command not found error occurs

@sammanak
Copy link

sammanak commented Jul 27, 2020

bash: line 1: 404:: command not found error occurs

it's related to file permission.
sudo chmod -R 755 install-mongodb-40-on-ubuntu-1804.sh
Then run it again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment