最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
Ubuntu中MongoDB 3.0安装与升级的方法
时间:2022-06-30 19:14:47 编辑:袖梨 来源:一聚教程网
由于服务器中使用了阿里云提供的源,安装的MongoDB版本太低(好像是MongoDB 2.0.4),MongoDB 3.0出来也有一段时间了,咱也尝尝鲜。下面来介绍我的升级方法,此安装方法来自于MongoDB官网http://docs.m*o*n*godb.org/manual/tutorial/install-mongodb-on-ubuntu/。 (小虾 虎鱼原创)
导入public GPG Key:
Import the public key used by the package management system: The Ubuntu package management tools (i.e. dpkg and apt) ensure package consistency and authenticity by requiring that distributors sign packages with GPG keys. Issue the following command to import the MongoDB public GPG Key:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
将MongoDB的源地址添加到源中
Create a list file for MongoDB: Create the /etc/apt/sources.list.d/mongodb-org-3.0.list list file using the following command:
echo "deb http://repo.m***ongodb.org/apt/ubuntu "$(lsb_release -sc)"/mongodb-org/3.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-3.0.list
更新源
Issue the following command to reload the local package database: Reload local package database
sudo apt-get update
安装MongoDB
Install the MongoDB packages: You can install either the latest stable version of MongoDB or a specific version of MongoDB.
安装最新稳定版的MongoDB
sudo apt-get install -y mongodb-org
安装特定版本的MongoDB
Specify each component package individually and append the version number to the package name, as in the following example
sudo apt-get install -y mongodb-org=3.0.1 mongodb-org-server=3.0.1 mongodb-org-shell=3.0.1 mongodb-org-mongos=3.0.1 mongodb-org-tools=3.0.1
最后可以通过命令mongo --version来查看MongoDB的版本号。
相关文章
- 不朽箴言资源怎么使用 资源使用推荐 09-19
- 不朽箴言心愿单怎么设置 心愿单设置推荐 09-19
- 原神蟹沙皇怎么打-蟹沙皇打法攻略 09-19
- 新三国志曹操传法正之影怎么过 法正之影过关攻略 09-19
- 三国望神州曹仁技能是什么 曹仁技能介绍一览 09-19
- DNF手游3月商店道具换什么好-2025年3月商店刷新道具兑换推荐 09-19