You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.5 KiB
34 lines
1.5 KiB
1 month ago
|
#!/bin/sh
|
||
|
|
||
|
# import the MongoDB public GPG Key
|
||
|
wget -qO - https://www.mongodb.org/static/pgp/server-5.0.asc | sudo apt-key add -
|
||
|
|
||
|
|
||
|
CODE_NAME=`lsb_release -c --short`
|
||
|
echo $CODE_NAME
|
||
|
|
||
|
# Create a list file for MongoDB
|
||
|
if [ $CODE_NAME = "bionic" ]; then
|
||
|
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
|
||
|
elif [ $CODE_NAME = "focal" ]; then
|
||
|
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
|
||
|
elif [ $CODE_NAME = "xenial" ]; then
|
||
|
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/5.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-5.0.list
|
||
|
else
|
||
|
echo "only ubuntu / 16 xenial / 18 bionic / 20 focal / support mongodb 5.0"
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
sudo apt-get update
|
||
|
|
||
|
# install mongodb 5.0.5
|
||
|
sudo apt-get install -y mongodb-org=5.0.5 mongodb-org-database=5.0.5 mongodb-org-server=5.0.5 mongodb-org-shell=5.0.5 mongodb-org-mongos=5.0.5 mongodb-org-tools=5.0.5
|
||
|
|
||
|
# ignore auto update
|
||
|
echo "mongodb-org hold" | sudo dpkg --set-selections
|
||
|
echo "mongodb-org-database hold" | sudo dpkg --set-selections
|
||
|
echo "mongodb-org-server hold" | sudo dpkg --set-selections
|
||
|
echo "mongodb-org-shell hold" | sudo dpkg --set-selections
|
||
|
echo "mongodb-org-mongos hold" | sudo dpkg --set-selections
|
||
|
echo "mongodb-org-tools hold" | sudo dpkg --set-selections
|