[DOCS-16028] Installation Instruction doesn't Work for Ubuntu 22.04 Created: 11/Apr/23  Updated: 20/Nov/23  Resolved: 15/Nov/23

Status: Closed
Project: Documentation
Component/s: manual, Server
Affects Version/s: None
Fix Version/s: Server_Docs_20231120

Type: Bug Priority: Major - P3
Reporter: Konstantin Trushin Assignee: Lauren Tran
Resolution: Duplicate Votes: 0
Labels: bug, release
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File screen_1.png     PNG File screen_2.png    
Participants:
Days since reply: 12 weeks ago

 Description   

The instruction for installing MongoDB Community Edition doesn't work for Ubuntu 22.04.
First, the gpg invocation in the following snippet

curl -fsSL https://pgp.mongodb.com/server-6.0.pub | \
   sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg

seems to be invalid because no gpg subcommand is specified. Please see the warning below.

$ curl -fsSL https://pgp.mongodb.com/server-6.0.pub | \
>    sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg
gpg: directory '/root/.gnupg' created
gpg: keybox '/root/.gnupg/pubring.kbx' created
gpg: WARNING: no command supplied.  Trying to guess what you mean ...
pub   rsa4096 2022-02-23 [SC] [expires: 2027-02-22]
      39BD841E4BE5FB195A65400E6A26B1AE64C3C388
uid           MongoDB 6.0 Release Signing Key <packaging@mongodb.com>

Moreover, the apt-get command doesn't see the public key file located at /usr/share/keyrings/mongodb-server-6.0.gpg. The proper directory for it is /etc/apt/trusted.gpg.d.
I managed to install MongoDB after changing

curl -fsSL https://pgp.mongodb.com/server-6.0.pub | \
   sudo gpg -o /usr/share/keyrings/mongodb-server-6.0.gpg

to

curl -fsSL https://pgp.mongodb.com/server-6.0.pub | \
    sudo tee /etc/apt/trusted.gpg.d/mongodb-server-6.0.gpg

and replacing

echo "deb [ arch=amd64,arm64 signed=/usr/share/keyrings/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list

with

echo "deb [ arch=amd64,arm64 signed=/etc/apt/trusted.gpg.d/mongodb-server-6.0.gpg ] https://repo.mongodb.org/apt/ubuntu jammy/mongodb-org/6.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-6.0.list

Debian and other Ubuntu versions may also be affected by the same inaccuracy in the installation instruction.
I attached some screenshots for illustration purposes.



 Comments   
Comment by Lauren Tran [ 15/Nov/23 ]

kenneth.dyer@mongodb.com and I tested the installation of MongoDB Community Edition on Ubuntu 22.04 and Debian and verified that the installation steps work for both. The pgp link on this ticket ends with .pub as opposed to in the docs where the pgp link ends with .asc which may have caused the original issue that is now resolved. 

Generated at Thu Feb 08 08:14:25 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.