- MongoDB 4 Quick Start Guide
- Doug Bierer
- 293字
- 2021-08-13 15:25:00
Package installation
To install MongoDB on an Ubuntu/Debian server, you will need root access. A unique feature of Debian-based Linux distributions is that direct login as root is not allowed for security reasons. Accordingly, you can promote yourself to root using su, or you can precede the various commands with sudo, which instructs the OS to process this command as root.
Please proceed as follows:
- Import the public key from the MongoDB key server. This is needed so that the package manager can authenticate the MongoDB package:

- Add the MongoDB repository to the Linux server's sources list:

The commands listed should be on one line. We use a backslash ( \) to indicate a line of text that is too long to fit the printed page. When typing the command, omit the backslash ( \) and do not hit enter until the command has been fully entered.
- Refresh the package database from the sources list by running:
sudo apt-get update
Ubuntu version 18.04 is code-named bionic. You will note this name is used in step #2 here, where the MongoDB repository is added to the sources list. If this source is not found, you will receive an error message:
The repository ... bionic/mongodb-org/4.0 ... does not have a Release file
In this situation, substitute the code name xenial (Ubuntu 16.04) in place of bionic (Ubuntu 18.04).
The repository ... bionic/mongodb-org/4.0 ... does not have a Release file
In this situation, substitute the code name xenial (Ubuntu 16.04) in place of bionic (Ubuntu 18.04).
- Install the latest (stable) version of MongoDB. Here, we install only the composite package, which alleviates the need to separately install the four primary packages listed previously:
sudo apt-get install -y mongodb-org
You will note, at the end of the installation, that the installer creates a user mongodb who belongs to a group mongodb, which is also newly created. This is the system user MongoDB uses when it runs.
推薦閱讀
- AutoCAD繪圖實用速查通典
- Practical Data Analysis
- 商戰數據挖掘:你需要了解的數據科學與分析思維
- Java實用組件集
- CorelDRAW X4中文版平面設計50例
- 自動化控制工程設計
- 智能生產線的重構方法
- Visual Studio 2010 (C#) Windows數據庫項目開發
- MATLAB-Simulink系統仿真超級學習手冊
- Web璀璨:Silverlight應用技術完全指南
- 案例解說Delphi典型控制應用
- ADuC系列ARM器件應用技術
- Learn Microsoft Azure
- 納米集成電路制造工藝(第2版)
- Mastering SQL Server 2014 Data Mining