I do not know how, but I managed to mess up apt-get. Executing

sudo su
apt-get update

I get errors like the following

W: http://security.debian.org/dists/stretch/updates/InRelease: The key(s) in the keyring /etc/apt/trusted.gpg are ignored as the file is not readable by user '_apt' executing apt-key.
W: GPG error: http://security.debian.org stretch/updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 9D6D8F6BC857C906 NO_PUBKEY 8B48AD6246925553
W: The repository 'http://security.debian.org stretch/updates InRelease' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.

for the repositories:

http://deb.debian.org/debian stretch-updates InRelease
http://deb.debian.org/debian stretch-proposed-updates InRelease
http://deb.debian.org/debian stretch Release

I understand that there are some keys missing and I tried to create them with

gpg --keyserver keyring.debian.org --recv-keys 8B48AD6246925553

but as a reply I got

gpg: no valid OpenPGP data found.
gpg: Total number processed: 0

Additionally I have another problem with http://deb.debian.org/debian stretch/main Translation-en:

E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/i18n/Translation-en  BZ2_bzread: /var/lib/apt/lists/partial/deb.debian.org_debian_dists_stretch_main_i18n_Translation-en.bz2 Read error (-5: DATA_ERROR_MAGIC)

which seems to have to do with the Zip-format!? No idea what I did.

Any ideas/hints how to fix my two problems?

Cheers, Christian


The simplest way to fix this is to manually download the debian-archive-keyring package and install that, then run apt update again. You’ll also need to restore the permissions on /etc/apt/trusted.gpg:

sudo chmod 444 /etc/apt/trusted.gpg

The Translations problem is a bad file on the servers, there’s nothing you can do about that.

  • Thanks for your comments. I downloaded the debian-archive-keyring package and installed it with sudo dpkg -i debian-archive-keyring_2017.5_all.deb, but apt update shows the same mistake: W: GPG error: deb.debian.org/debian stretch-proposed-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 8B48AD6246925553 NO_PUBKEY 7638D0442B90D010 – Christian Lomp Jun 18 '19 at 14:33
  • Oh, I missed the permission error, see my update. – Stephen Kitt Jun 18 '19 at 14:44
  • I did this, but the error persists. The size of my trusted.gpg is only 32 bytes, so I believe it is empty. If I do apt-key list I do not see any keys. Also the directory trusted.gpg.d is empty ? Any idea how to restore this? – Christian Lomp Jun 18 '19 at 14:53
  • Re-installing debian-archive-keyring is supposed to restore the contents of the trusted.gpg.d directory. – Stephen Kitt Jun 18 '19 at 14:54
  • Thanks for trying to help, but in either way doing sudo apt-get install --reinstall debian-archive-keyring or via dpkg from the downloaded deb-file, the directory /etc/apt/trusted.gpg.d stays empty. Apt-get lets me reinstall the debian-archive-keyring, but warns that the package cannot be authenticated. – Christian Lomp Jun 18 '19 at 14:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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