Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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? :)

share|improve this question

2 Answers 2

up vote 6 down vote accepted

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
share|improve this answer

Additionally, you could use apt-key to add the key for you in instead of manually dropping a file to that path. Assuming you saved the file as Opera.key:

sudo apt-key add Opera.key

You could even download and import the key file on-the-fly, instead of saving it to a local file:

wget -q -O - http://deb.opera.com/archive.key | sudo apt-key add -

Apt-key manages the contents of /etc/apt/trusted.gpg main file instead of using the directory, which may be a convenience or a burden for you.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.