Different guides point to different locations. This is because both locations will work, and actually it's up to you to decide where you put them.
But it seems that particular guide is wrong, since it says you should put the keyring in /usr/share/keyrings/
, but then points to /etc/apt/keyrings/
in the sources file. You should choose one or the other - mixing the two is definitely wrong. (You could probably write to TecMint and point out the error in their article.)
The manpage for sources.list
(invoked by man sources.list
) actually mention these locations in the following section:
THE DEB AND DEB-SRC TYPES: OPTIONS
- Signed-By (signed-by) is an option to require a repository to pass apt-secure(8) verification with a certain set of keys rather than all
trusted keys apt has configured. It is specified as a list of absolute
paths to keyring files (have to be accessible and readable for the
_apt system user, so ensure everyone has read-permissions on the file) and fingerprints of keys to select from these keyrings. The
recommended locations for keyrings are
/usr/share/keyrings
for
keyrings managed by packages, and /etc/apt/keyrings
for keyrings
managed by the system operator. If no keyring files are specified the
default is the trusted.gpg keyring and all keyrings in the trusted.gpg.d/
directory (...)
However, there is no clear definition of what exactly is meant by "managed by packages" and "managed by system operator". To me, this indicates there is no definite right or wrong here (since it's only a recommendation), except it should be consistent between where you put the keys, and where you refer them in the sources file.
However, I think it's logical to put apt
keyrings under the /etc/apt/
folder, whereas keyrings for other purposes of an application could be put under /usr/share/keyrings
. In addition, apt
has another folder called /etc/apt/trusted.gpg.d/
, where the trusted keyrings for Ubuntu are stored (which is also mentioned in the manpage).
Also, read here about why GPG keys are Ascii armored - this is also a choice completely left to the issuer (I've seen both armored and binary public keys).