|
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.
|