keywords
vagrant mongodb 鬼吹灯
Checkout
- vagrant
- mongodb
# 停止后台守护进程
sudo service mongod stop
# 卸载程序
sudo apt-get purge mongod*
# 清除残留文件
sudo rm /var/lib/mongod
sudo rm /var/log/mongod
# 导入库源
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927
# ubuntu 16
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.2.list
# 更新源
sudo apt-get update
# insall
sudo apt-get install -y mongodb-org
# 固定版本
echo "mongodb-org 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