I am facing a problem on Ubuntu 18.04 (Bionic Beaver) with apt and the way it deals with trusted keys to authenticate repositories.
On Ubuntu 14.04 we used to install the key that was used sign the repository of our software releases as keyring to /etc/apt/trusted.gpg.d
. By this apt knows that the key is trusted.
However, this seems to not work anymore on Ubuntu 18.04. If I do the same there, I get an error during updating:
# apt-get update
Hit:1 http://company.com/ubuntu-snapshot bionic InRelease
Reading package lists... Done
W: http://company.com/ubuntu-snapshot/dists/bionic/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/company-keys.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
The obvious attempt to fix it by
# sudo chown -v _apt /etc/apt/trusted.gpg.d/company-keys.gpg
changed ownership of '/etc/apt/trusted.gpg.d/company-keys.gpg' from root to _apt
does not work, as apt-get update
then yields:
# apt-get update
Hit:1 http://company.com/ubuntu-snapshot bionic InRelease
Reading package lists... Done
W: http://company.com/ubuntu-snapshot/dists/bionic/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg.d/company-keys.gpg are ignored as the file has an unsupported filetype.
The key itself is valid, if I add it with the following line everything works as expected:
wget -O - http://company.com/key.gpg | sudo apt-key add -
The latter is unfortunately not an option for us since we want to deploy our own keys and also have the ability to change/revoke them.
I could neither figure out why apt rejects the keyring in /etc/apt/trusted.gpg.d
, nor could I find a changelog describing different expectations of apt for the new Ubuntu version. Would be very glad if you point to some resource to overcome this issue.