Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-16028

Installation Instruction doesn't Work for Ubuntu 22.04

    XMLWordPrintableJSON

Details

    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.

      Attachments

        1. screen_1.png
          screen_1.png
          149 kB
        2. screen_2.png
          screen_2.png
          148 kB

        Activity

          People

            lauren.tran@mongodb.com Lauren Tran
            konstantin.trushin@percona.com Konstantin Trushin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              12 weeks ago