Update Jessie to Stretch results in unknown apt-key errors

Hello,
I am using a RPi3, having installed OSMC, added a MySQL-Server, an owncloud-server , configured cron-apt (everything done under Jessie) and all worked relatively good.

First issue has been the cron-apt errors concerning multiple configuration of target packages

W: Target Packages (main/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1

But since this have been only warnings and cron-apt did its job, I have ignored this due to work-pressure.

But since the end of April, I have a severe issue concerning apt-key, which prevents the download of the package-lists.

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.debian.org stretch/updates InRelease: Unknown error executing apt-key

Please forgive me, because I am no professional Linux-user, so please tell me exactly what to do, to give you the data you need.

With kind regards
Martin

To get a better understanding of the problem you are experiencing we need more information from you. The best way to get this information is for you to upload logs that demonstrate your problem. You can learn more about how to submit a useful support request here.

So, in summary:

  • activate the logging
  • reboot the OSMC device
  • reproduce the issue
  • upload the log set either using the Log Uploader method within the My OSMC menu in the GUI or the ssh method invoking command grab-logs -A
  • publish the provided URL from the log set upload, here

Thanks for your understanding. We hope that we can help you get up and running again shortly.

Unattended upgrades (such as Cron apt) aren’t recommended or supported as they can cause undesirable effects.

Sam

I hope that I did it correctly:

sudo apt-get update | grab-logs -A
Logs successfully uploaded.
Logs available at https://paste.osmc.tv/adufequkey

sudo apt-get update | paste-log

Thats gives just the output of apt-get update

it worked, anyway. Grateful if someone with better German than me can have a look at the apt term log.

I can only put 5 links per post:

sudo apt-get update | paste-log
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.debian.org stretch/updates InRelease: Unbekannter Fehler beim Ausführen von apt-key
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ftp.debian.org/debian stretch Release: Unbekannter Fehler beim Ausführen von apt-key
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ftp.debian.org/debian stretch-updates InRelease: Unbekannter Fehler beim Ausführen von apt-key
W: GPG-Fehler: http://ftp.fau.de/osmc/osmc/apt stretch InRelease: Unbekannter Fehler beim Ausführen von apt-key
E: The repository ‘http://apt.osmc.tv stretch InRelease’ is not signed.

W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ftp.debian.org/debian stretch-backports InRelease: Unbekannter Fehler beim Ausführen von apt-key
W: Target Packages (main/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1
W: Target Translations (main/i18n/Translation-de_DE) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1
W: Target Translations (main/i18n/Translation-de) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1

W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1
W: Target Packages (contrib/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1
W: Target Packages (contrib/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1
W: Target Translations (contrib/i18n/Translation-de_DE) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1
W: Target Translations (contrib/i18n/Translation-de) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1

W: Target Translations (contrib/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1
W: Target Packages (non-free/binary-armhf/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1
W: Target Packages (non-free/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1
W: Target Translations (non-free/i18n/Translation-de_DE) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1
W: Target Translations (non-free/i18n/Translation-de) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1

W: Target Translations (non-free/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:7 and /etc/apt/sources.list.d/security.list:1
https://paste.osmc.tv/belugefuce

First of all, please show us /etc/apt/sources.list.d/security.list since it seems to be causing problems.

According to Big G, the error “Unbekannter Fehler beim Ausführen von apt-key” translates as “Unknown error while running apt-key”. Therefore, please run apt-key list and post the output. If it throws an error, please run md5sum /usr/bin/apt-key. The result should be a479267a797c113b59b1a8b543c0870f.

First; cat /etc/apt/sources.list.d/security.list gives

deb http://security.debian.org/ stretch/updates main contrib non-free
#deb-src http://security.debian.org/ jessie/updates main

Second: apt-key list gives

/etc/apt/trusted.gpg.d/debian-archive-jessie-automatic.gpg

pub rsa4096 2014-11-21 [SC] [expires: 2022-11-19]
126C 0D24 BD8A 2942 CC7D F8AC 7638 D044 2B90 D010
uid [ unknown] Debian Archive Automatic Signing Key (8/jessie) ftpmaster@debian.org

/etc/apt/trusted.gpg.d/debian-archive-jessie-security-automatic.gpg

pub rsa4096 2014-11-21 [SC] [expires: 2022-11-19]
D211 6914 1CEC D440 F2EB 8DDA 9D6D 8F6B C857 C906
uid [ unknown] Debian Security Archive Automatic Signing Key (8/jessie) ftpmaster@debian.org

/etc/apt/trusted.gpg.d/debian-archive-jessie-stable.gpg

pub rsa4096 2013-08-17 [SC] [expires: 2021-08-15]
75DD C3C4 A499 F1A1 8CB5 F3C8 CBF8 D6FD 518E 17E1
uid [ unknown] Jessie Stable Release Key debian-release@lists.debian.org

/etc/apt/trusted.gpg.d/debian-archive-stretch-automatic.gpg

pub rsa4096 2017-05-22 [SC] [expires: 2025-05-20]
E1CF 20DD FFE4 B89E 8026 58F1 E0B1 1894 F66A EC98
uid [ unknown] Debian Archive Automatic Signing Key (9/stretch) ftpmaster@debian.org
sub rsa4096 2017-05-22 [S] [expires: 2025-05-20]

/etc/apt/trusted.gpg.d/debian-archive-stretch-security-automatic.gpg

pub rsa4096 2017-05-22 [SC] [expires: 2025-05-20]
6ED6 F5CB 5FA6 FB2F 460A E88E EDA0 D238 8AE2 2BA9
uid [ unknown] Debian Security Archive Automatic Signing Key (9/stretch) ftpmaster@debian.org
sub rsa4096 2017-05-22 [S] [expires: 2025-05-20]

/etc/apt/trusted.gpg.d/debian-archive-stretch-stable.gpg

pub rsa4096 2017-05-20 [SC] [expires: 2025-05-18]
067E 3C45 6BAE 240A CEE8 8F6F EF0F 382A 1A7B 6500
uid [ unknown] Debian Stable Release Key (9/stretch) debian-release@lists.debian.org

/etc/apt/trusted.gpg.d/debian-archive-wheezy-automatic.gpg

pub rsa4096 2012-04-27 [SC] [expires: 2020-04-25]
A1BD 8E9D 78F7 FE5C 3E65 D8AF 8B48 AD62 4692 5553
uid [ unknown] Debian Archive Automatic Signing Key (7.0/wheezy) ftpmaster@debian.org

/etc/apt/trusted.gpg.d/debian-archive-wheezy-stable.gpg

pub rsa4096 2012-05-08 [SC] [expires: 2019-05-07]
ED6D 6527 1AAC F0FF 15D1 2303 6FB2 A1C2 65FF B764
uid [ unknown] Wheezy Stable Release Key debian-release@lists.debian.org

No error and the md5sum /usr/bin/apt-key gives the expected result.

You should remove the file since it duplicates what’s already in /etc/apt/sources.list and will cause the “multiple times” error.

The output from apt-key list looks to be ok except that it’s missing the OSMC key. That is odd since I see that you have successfully updated from the OSMC repo. What’s the output from running ls -l /etc/apt/trusted.gpg.d and ls -l /etc/apt?

Remove: Not done. Can’t use sudo anymore?!
Update: "Speicherzugriffsfehler (segmentation fault), had to reboot. Now done.

ls -l /etc/apt/trusted.gpg.d
insgesamt 48
-rw-r–r-- 1 root root 5138 Nov 30 2014 debian-archive-jessie-automatic.gpg
-rw-r–r-- 1 root root 5147 Nov 30 2014 debian-archive-jessie-security-automatic.gpg
-rw-r–r-- 1 root root 2775 Nov 30 2014 debian-archive-jessie-stable.gpg
-rw-r–r-- 1 root root 7483 Jun 18 2017 debian-archive-stretch-automatic.gpg
-rw-r–r-- 1 root root 7492 Jun 18 2017 debian-archive-stretch-security-automatic.gpg
-rw-r–r-- 1 root root 2275 Jun 18 2017 debian-archive-stretch-stable.gpg
-rw-r–r-- 1 root root 3780 Nov 30 2014 debian-archive-wheezy-automatic.gpg
-rw-r–r-- 1 root root 2851 Nov 30 2014 debian-archive-wheezy-stable.gpg

ls -l /etc/apt
insgesamt 24
drwxr-xr-x 2 root root 4096 Apr 30 11:19 apt.conf.d
drwxr-xr-x 2 root root 4096 Apr 30 11:14 preferences.d
-rw-r–r-- 1 root root 302 Mai 10 13:13 sources.list
drwxr-xr-x 2 root root 4096 Jul 4 00:18 sources.list.d
-rw-r–r-- 1 root root 1197 Jan 28 2017 trusted.gpg.bak
drwxr-xr-x 2 root root 4096 Jul 3 15:36 trusted.gpg.d

That’s a bit worrying, but now that the file has been removed, have you tried running sudo apt-get update to see if the “multiple times” error has gone?

As for the unknown apt-key error, please run

sudo apt-get update -o Debug::Acquire::gpgv=true 2>&1 | paste-log

and provide the URL.

If I looked forward to it :wink:

sudo apt-get update
Holen:1 http://security.debian.org stretch/updates InRelease [94,3 kB]
Ign:2 http://ftp.debian.org/debian stretch InRelease
OK:6 http://ftp.debian.org/debian stretch Release
Holen:4 http://ftp.debian.org/debian stretch-updates InRelease [91,0 kB]
Holen:3 http://ftp.fau.de/osmc/osmc/apt stretch InRelease [4.664 B]
Holen:5 http://ftp.debian.org/debian stretch-backports InRelease [91,8 kB]
Fehl:1 http://security.debian.org stretch/updates InRelease
Unbekannter Fehler beim Ausführen von apt-key
Fehl:7 http://ftp.debian.org/debian stretch Release.gpg
Unbekannter Fehler beim Ausführen von apt-key
Fehl:3 http://ftp.fau.de/osmc/osmc/apt stretch InRelease
Unbekannter Fehler beim Ausführen von apt-key
Fehl:4 http://ftp.debian.org/debian stretch-updates InRelease
Unbekannter Fehler beim Ausführen von apt-key
Fehl:5 http://ftp.debian.org/debian stretch-backports InRelease
Unbekannter Fehler beim Ausführen von apt-key
Paketlisten werden gelesen… Fertig
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.debian.org stretch/updates InRelease: Unbekannter Fehler beim Ausführen von apt-key
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ftp.debian.org/debian stretch Release: Unbekannter Fehler beim Ausführen von apt-key
W: GPG-Fehler: http://ftp.fau.de/osmc/osmc/apt stretch InRelease: Unbekannter Fehler beim Ausführen von apt-key
E: The repository ‘http://apt.osmc.tv stretch InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ftp.debian.org/debian stretch-updates InRelease: Unbekannter Fehler beim Ausführen von apt-key
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ftp.debian.org/debian stretch-backports InRelease: Unbekannter Fehler beim Ausführen von apt-key

sudo apt-get update -o Debug::Acquire::gpgv=true 2>&1 | paste-log
https://paste.osmc.tv/qoziqujiga

Well, it seems that this message might be a step forward:

gpgv exited with status 139

I’m very short of time this evening, so it’ll have to wait until tomorrow, but perhaps it might be worth reinstalling gpgv and libgcrypt20:

sudo apt-get install --reinstall gpgv libgcrypt20

and see if the problem persists.

Sorry, but this didn’t work:

sudo apt-get install --reinstall gpgv libgcrypt20
Paketlisten werden gelesen… Fertig
Abhängigkeitsbaum wird aufgebaut.
Statusinformationen werden eingelesen… Fertig
0 aktualisiert, 0 neu installiert, 2 erneut installiert, 0 zu entfernen und 0 nicht aktualisiert.
Es müssen noch 0 B von 920 kB an Archiven heruntergeladen werden.
Nach dieser Operation werden 0 B Plattenplatz zusätzlich benutzt.
(Lese Datenbank … 55175 Dateien und Verzeichnisse sind derzeit installiert.)
Vorbereitung zum Entpacken von …/gpgv_2.1.18-8~deb9u1_armhf.deb …
Entpacken von gpgv (2.1.18-8~deb9u1) über (2.1.18-8~deb9u1) …
Vorbereitung zum Entpacken von …/libgcrypt20_1.7.6-2+deb9u2_armhf.deb …
Entpacken von libgcrypt20:armhf (1.7.6-2+deb9u2) über (1.7.6-2+deb9u2) …
libgcrypt20:armhf (1.7.6-2+deb9u2) wird eingerichtet …
gpgv (2.1.18-8~deb9u1) wird eingerichtet …
Trigger für libc-bin (2.24-11+deb9u3) werden verarbeitet …
Trigger für man-db (2.7.6.1-2) werden verarbeitet …

And the important sudo apt-get update gave:

Ign:1 http://ftp.debian.org/debian stretch InRelease
Holen:5 http://security.debian.org stretch/updates InRelease [94,3 kB]
OK:6 http://ftp.debian.org/debian stretch Release
Holen:2 http://ftp.debian.org/debian stretch-updates InRelease [91,0 kB]
Holen:3 http://ftp.fau.de/osmc/osmc/apt stretch InRelease [4.664 B]
Holen:4 http://ftp.debian.org/debian stretch-backports InRelease [91,8 kB]
Fehl:5 http://security.debian.org stretch/updates InRelease
Unbekannter Fehler beim Ausführen von apt-key
Fehl:7 http://ftp.debian.org/debian stretch Release.gpg
Unbekannter Fehler beim Ausführen von apt-key
Fehl:2 http://ftp.debian.org/debian stretch-updates InRelease
Unbekannter Fehler beim Ausführen von apt-key
Fehl:3 http://ftp.fau.de/osmc/osmc/apt stretch InRelease
Unbekannter Fehler beim Ausführen von apt-key
Fehl:4 http://ftp.debian.org/debian stretch-backports InRelease
Unbekannter Fehler beim Ausführen von apt-key
Paketlisten werden gelesen… Fertig
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.debian.org stretch/updates InRelease: Unbekannter Fehler beim Ausführen von apt-key
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ftp.debian.org/debian stretch Release: Unbekannter Fehler beim Ausführen von apt-key
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ftp.debian.org/debian stretch-updates InRelease: Unbekannter Fehler beim Ausführen von apt-key
W: GPG-Fehler: http://ftp.fau.de/osmc/osmc/apt stretch InRelease: Unbekannter Fehler beim Ausführen von apt-key
E: The repository ‘http://apt.osmc.tv stretch InRelease’ is not signed.
N: Updating from such a repository can’t be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ftp.debian.org/debian stretch-backports InRelease: Unbekannter Fehler beim Ausführen von apt-key