Ubuntu – Additional keyrings for APT in trusted.gpg.d

aptrepository

I'm creating a package that will automatically install some repositories to all hosts in the LAN. The package will be accessible from the central repository.

I've discovered that repo lists can be dropped in '/etc/apt/sources.list.d/*.list'. Now I need to import their keys, for instance, this one. However, when I drop it into '/etc/apt/trusted.gpg.d/Opera.gpg', apt-get update gives me a plenty of NO_PUBKEY errors for all repos I have, including Opera!

What's wrong? 🙂

Best Answer

Keys downloaded from repositories should be joint into a new GPG keyring so you can drop them into '/etc/apt/trusted.gpg.d/*.gpg', like this:

gpg --no-default-keyring --keyring ./Opera.gpg --import Opera.key
sudo cp Opera.gpg /etc/apt/trusted.gpg.d/Opera.gpg