导入秘钥:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 9DA31620334BD75D9DCB49F368818C72E52529D4
添加源:
echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.0.list
更新源:
sudo apt-get update
安装MongoDB:
sudo apt-get install -y mongodb-org
其实到现在已经简单安装成功了下面我们需要配置一下自启动
[注意:Deepin中默认没有rc.local文件,Ubantu中默认有吧貌似,没用过]
sudo gedit /etc/rc.local
# 使用gedit创建并打开文件之后输入一下模板
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script jus