How To Install MongoDB version 6.0 on Ubuntu 22.04 (LTS) x64

I follow this But I got Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)). Jave any tutorial for this?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

I followed that documentation below. It works like charm:

Site Moderator
Site Moderator badge
December 25, 2022

Hi @sittiphansittisak,

Adding a key to /etc/apt/trusted.gpg.d is insecure because it adds the key for all repositories. This is exactly why apt-key had to be deprecated.

If you want to use the key at for a repository listed in /etc/apt/sources.list.d/EXAMPLE.list, use:

sudo mkdir -p /etc/apt/keyrings/
wget -O- |
    gpg --dearmor |
    sudo tee /etc/apt/keyrings/EXAMPLE.gpg > /dev/null

echo "deb [signed-by=/etc/apt/keyrings/EXAMPLE.gpg] stable main" |
    sudo tee /etc/apt/sources.list.d/EXAMPLE.list

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up