|
| 1 | +title: Import the public key used by the package management system. |
| 2 | +stepnum: 1 |
| 3 | +level: 4 |
| 4 | +ref: import-key |
| 5 | +content: | |
| 6 | + From a terminal, issue the following command to import the |
| 7 | + MongoDB public GPG Key from `<https://www.mongodb.org/static/pgp/server-{+pgp-version+}.asc>`_: |
| 8 | +
|
| 9 | + .. code-block:: sh |
| 10 | +
|
| 11 | + wget -qO - https://www.mongodb.org/static/pgp/server-{+pgp-version+}.asc | sudo apt-key add - |
| 12 | +
|
| 13 | + The operation should respond with an ``OK``. |
| 14 | + |
| 15 | + However, if you receive an error indicating that ``gnupg`` is not |
| 16 | + installed, you can: |
| 17 | + |
| 18 | + #. Install ``gnupg`` and its required libraries using the following command: |
| 19 | +
|
| 20 | + .. code-block:: sh |
| 21 | +
|
| 22 | + sudo apt-get install gnupg |
| 23 | + |
| 24 | + #. Once installed, retry importing the key: |
| 25 | +
|
| 26 | + .. code-block:: sh |
| 27 | +
|
| 28 | + wget -qO - https://www.mongodb.org/static/pgp/server-{+pgp-version+}.asc | sudo apt-key add - |
1 | 29 | ---
|
2 |
| -source: |
3 |
| - file: steps-install-shell-base.yaml |
4 |
| - ref: navigate-dlc |
5 |
| -ref: navigate-dlc-linux-deb |
| 30 | +title: Create a list file for MongoDB. |
| 31 | +stepnum: 2 |
| 32 | +level: 4 |
| 33 | +ref: sources-list |
| 34 | +content: | |
| 35 | +
|
| 36 | + Create the list file |
| 37 | + ``/etc/apt/sources.list.d/mongodb-org-{+mdb-version+}.list`` for your |
| 38 | + version of Ubuntu. |
| 39 | +
|
| 40 | + Click on the appropriate tab for your version of Ubuntu. |
| 41 | + If you are unsure of what Ubuntu version the host is running, |
| 42 | + open a terminal or shell on the host and execute ``lsb_release -dc``. |
| 43 | +
|
| 44 | + .. tabs:: |
| 45 | +
|
| 46 | + tabs: |
| 47 | + - id: focal |
| 48 | + name: Ubuntu 20.04 (Focal) |
| 49 | + content: | |
| 50 | +
|
| 51 | + The following instruction is for **Ubuntu 20.04 (Focal)**. |
| 52 | + For Ubuntu 18.04 (Bionic) click on the appropriate tab. |
| 53 | +
|
| 54 | + Create the |
| 55 | + ``/etc/apt/sources.list.d/mongodb-org-{+mdb-version+}.list`` |
| 56 | + file for Ubuntu 20.04 (Focal): |
| 57 | +
|
| 58 | + .. code-block:: sh |
| 59 | +
|
| 60 | + echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu focal/mongodb-org/{+mdb-version+} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-{+mdb-version+}.list |
| 61 | + |
| 62 | + - id: bionic |
| 63 | + name: Ubuntu 18.04 (Bionic) |
| 64 | + content: | |
| 65 | +
|
| 66 | + The following instruction is for **Ubuntu 18.04 |
| 67 | + (Bionic)**. For Ubuntu 20.04 (Focal) click on the |
| 68 | + appropriate tab. |
| 69 | +
|
| 70 | + Create the |
| 71 | + ``/etc/apt/sources.list.d/mongodb-org-{+mdb-version+}.list`` |
| 72 | + file for Ubuntu 18.04 (Bionic): |
| 73 | +
|
| 74 | + .. code-block:: sh |
| 75 | +
|
| 76 | + echo "deb [ arch=amd64,arm64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/{+mdb-version+} multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-{+mdb-version+}.list |
6 | 77 | ---
|
7 |
| -title: "Download the Debian 64-bit ``.deb`` package." |
8 |
| -ref: download-archive-rhel |
9 |
| -level: 4 |
| 78 | +title: Reload local package database. |
| 79 | +stepnum: 3 |
| 80 | +level: 4 |
| 81 | +ref: reload |
| 82 | +content: | |
| 83 | +
|
| 84 | + Issue the following command to reload the local package database: |
| 85 | +
|
| 86 | + .. code-block:: sh |
| 87 | +
|
| 88 | + sudo apt-get update |
10 | 89 | ---
|
11 |
| -title: "Extract and install the ``.deb`` package." |
12 |
| -ref: extract-archive-linux-deb |
| 90 | +title: Install the ``mongosh`` package. |
| 91 | +stepnum: 4 |
13 | 92 | level: 4
|
| 93 | +ref: install |
14 | 94 | content: |
|
15 |
| - To install the |mdb-shell|, run the following command from the |
16 |
| - directory containing the ``mongosh`` ``.deb`` package: |
| 95 | +
|
| 96 | + To install the latest stable version of ``mongosh``, issue the |
| 97 | + following command: |
17 | 98 |
|
18 | 99 | .. code-block:: sh
|
19 | 100 |
|
20 |
| - sudo dpkg --install mongosh_{+version+}_amd64.deb |
| 101 | + sudo apt-get install -y mongosh |
| 102 | + |
| 103 | + Optional. ``apt-get`` will upgrade the packages when a newer version |
| 104 | + becomes available. To prevent unintended upgrades, you can pin the |
| 105 | + package at the currently installed version: |
| 106 | +
|
| 107 | + .. code-block:: sh |
| 108 | +
|
| 109 | + echo "mongosh hold" | sudo dpkg --set-selections |
| 110 | +
|
21 | 111 | ...
|
0 commit comments