Ubuntu18.04安装MongoDB
1. 导入MongoDB的包公钥
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 2930ADAE8CAF5059EE73BB4B58712A2291FA4AD5
2. 创建源列表文件
echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.6 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.6.list
3. 更新软件源
sudo apt-get update
4. 安装MongoDB
sudo apt-get install -y mongodb-org
5. 查询版本号.
mongo --version
*********
如安装过程出现类似:
dpkg: error processing /var/cache/apt/archives/mongodb-org-server_4.2.1_amd64.deb
...
的错误的时候,依次覆盖冲突文件
sudo dpkg -i --force-overwrite /var/cache/apt/archives/mongodb-org-server_4.2.1_amd64.deb sudo dpkg -i --force-overwrite /var/cache/apt/archives/mongodb-org-mongos_4.2.1_amd64.deb sudo dpkg -i --force-overwrite /var/cache/apt/archives/mongodb-org-tools_4.2.1_amd64.
然后重新修复安装即可
sudo apt-get -f install
相关推荐
sunnnyduan 2020-10-16
lbyd0 2020-11-17
BigYellow 2020-11-16
sushuanglei 2020-11-12
我心似明月 2020-11-09
zhushenghan 2020-11-09
不要皱眉 2020-10-14
xiaohai 2020-09-29
songxiugongwang 2020-09-22
萌亖 2020-09-17
LuckyLXG 2020-09-08
sdmzhu 2020-09-01
mkhhxxttxs 2020-09-16
xiaohai 2020-09-16
newcome 2020-09-09
jaylong 2020-08-19
大秦铁骑 2020-08-19
thatway 2020-08-19