This repository has been archived on 2024-03-20. You can view files and clone it, but cannot push or open issues or pull requests.
thelinuxlist/scripts/mongodbinstall.sh

31 lines
1.0 KiB
Bash
Raw Normal View History

2022-10-19 21:53:10 -07:00
#!/bin/bash
2022-10-20 11:01:07 -07:00
while true
do
read -r -p "Would you like to install MongoDB? [Y/n] " input
case $input in
[yY][eE][sS]|[yY])
break
;;
[nN][oO]|[nN])
break
;;
*)
2022-10-20 11:03:05 -07:00
echo "That wasn't an option..."
2022-10-20 11:01:07 -07:00
;;
esac
2022-10-19 21:53:10 -07:00
done
sudo apt update && apt upgrade -y
2023-02-22 18:14:05 -08:00
sudo apt install wget curl gnupg2 software-properties-common apt-transport-https ca-certificates lsb-release -y
sudo curl -fsSL https://www.mongodb.org/static/pgp/server-6.0.asc | sudo apt-key add -
echo "deb http://security.ubuntu.com/ubuntu jammy-security main" | sudo tee /etc/apt/sources.list.d/jammy-security.list
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list
2022-10-19 21:59:42 -07:00
sudo apt update -y
sudo apt-get install libssl1.1 -y
2022-10-19 21:53:10 -07:00
sudo apt install mongodb-org -y
sudo systemctl start mongod
2022-10-19 22:00:52 -07:00
sudo systemctl enable mongod
apt autoremove -y