-wget -qO- https://myrepo.example/myrepo.asc | sudo apt-key add -
+wget -qO- https://myrepo.example/myrepo.asc | sudo tee /etc/apt/trusted.gpg.d/myrepo.asc curl -fsSL https://apt.releases.hashicorp.com/gpg |
-sudo apt-key add -
+sudo gpg --dearmor -o /etc/apt/keyrings/hashicorp-archive-keyring.gpgMake sure to use the "asc" extension for ASCII armored keys and the "gpg" extension for the binary OpenPGP format.
Recommended: Instead of placing keys into the /etc/apt/trusted.gpg.d directory, you can place them anywhere on your filesystem by using the Signed-By option in your sources.list and pointing to the filename of the key:
Legacy format:
deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ noble mainDEB822-formatted:
Types: deb
URIs: http://security.ubuntu.com/ubuntu
Suites: noble-security
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg