[SOLVED] "Unknown error executing apt-key" during updates afer 6.1 kernel update

Nov 10, 2021
7
1
8
46
Good morning all,

I updated to kernel 6.1 sometime around Dec 20th, and have started to notice the following errors when I try to update my system.

Code:
starting apt-get update
Hit:1 http://ftp.us.debian.org/debian bullseye InRelease
Get:2 http://security.debian.org bullseye-security InRelease [48.4 kB]
Get:3 http://ftp.us.debian.org/debian bullseye-updates InRelease [44.1 kB]
Err:1 http://ftp.us.debian.org/debian bullseye InRelease
  Unknown error executing apt-key
Err:2 http://security.debian.org bullseye-security InRelease
  Unknown error executing apt-key
Err:3 http://ftp.us.debian.org/debian bullseye-updates InRelease
  Unknown error executing apt-key
Get:4 http://download.proxmox.com/debian/pve bullseye InRelease [2661 B]
Err:4 http://download.proxmox.com/debian/pve bullseye InRelease
  Unknown error executing apt-key
Fetched 46.7 kB in 0s (114 kB/s)
Reading 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://ftp.us.debian.org/debian bullseye InRelease: Unknown error executing 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://security.debian.org bullseye-security InRelease: Unknown error executing 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.us.debian.org/debian bullseye-updates InRelease: Unknown error executing 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://download.proxmox.com/debian/pve bullseye InRelease: Unknown error executing apt-key
W: Failed to fetch http://ftp.us.debian.org/debian/dists/bullseye/InRelease  Unknown error executing apt-key
W: Failed to fetch http://ftp.us.debian.org/debian/dists/bullseye-updates/InRelease  Unknown error executing apt-key
W: Failed to fetch http://download.proxmox.com/debian/pve/dists/bullseye/InRelease  Unknown error executing apt-key
W: Failed to fetch http://security.debian.org/dists/bullseye-security/InRelease  Unknown error executing apt-key
W: Some index files failed to download. They have been ignored, or old ones used instead.
TASK OK

I'm not a linux expert by any stretch of the imagination, and I have no idea if it is related to the 6.1 update. I've been trying to search for solutions online, but I haven't found anything that would help. Anyone have any ideas?

Thanks,
D
 
Thank you, Cheiss, for the reply. Here is the info:

Code:
root@pve:~# pveversion -v
proxmox-ve: residual config (running kernel: 6.1.0-1-pve)
pve-manager: 7.3-3 (running version: 7.3-3/c3928077)
pve-kernel-6.1: 7.3-1
pve-kernel-helper: 7.3-1
pve-kernel-5.11: 7.0-10
pve-kernel-5.4: 6.4-6
pve-kernel-6.1.0-1-pve: 6.1.0-1
pve-kernel-5.11.22-7-pve: 5.11.22-12
pve-kernel-5.11.22-5-pve: 5.11.22-10
pve-kernel-5.4.140-1-pve: 5.4.140-1
pve-kernel-5.4.34-1-pve: 5.4.34-2
ceph-fuse: 14.2.21-1
corosync: 3.1.7-pve1
criu: 3.15-1+pve-1
glusterfs-client: 9.2-1
ifupdown: residual config
ifupdown2: 3.1.0-1+pmx3
ksm-control-daemon: 1.4-1
libjs-extjs: 7.0.0-1
libknet1: 1.24-pve2
libproxmox-acme-perl: 1.4.3
libproxmox-backup-qemu0: 1.3.1-1
libpve-access-control: 7.2-5
libpve-apiclient-perl: 3.2-1
libpve-common-perl: 7.3-1
libpve-guest-common-perl: 4.2-3
libpve-http-server-perl: 4.1-5
libpve-storage-perl: 7.3-1
libqb0: 1.0.5-1
libspice-server1: 0.14.3-2.1
lvm2: 2.03.11-2.1
lxc-pve: 5.0.0-3
lxcfs: 4.0.12-pve1
novnc-pve: 1.3.0-3
proxmox-backup-client: 2.3.1-1
proxmox-backup-file-restore: 2.3.1-1
proxmox-mini-journalreader: 1.3-1
proxmox-offline-mirror-helper: 0.5.0-1
proxmox-widget-toolkit: 3.5.3
pve-cluster: 7.3-1
pve-container: 4.4-2
pve-docs: 7.3-1
pve-edk2-firmware: 3.20220526-1
pve-firewall: 4.2-7
pve-firmware: 3.6-1
pve-ha-manager: 3.5.1
pve-i18n: 2.8-1
pve-qemu-kvm: 7.1.0-4
pve-xtermjs: 4.16.0-1
qemu-server: 7.3-1
smartmontools: 7.2-pve3
spiceterm: 3.2-2
swtpm: 0.8.0~bpo11+2
vncterm: 1.7-1
zfsutils-linux: 2.1.6-pve1
root@pve:~#

Code:
root@pve:~# ldd $(which gpg)
        linux-vdso.so.1 (0x00007ffdfa5c8000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f0887a2b000)
        libbz2.so.1.0 => /lib/x86_64-linux-gnu/libbz2.so.1.0 (0x00007f0887a18000)
        libsqlite3.so.0 => /lib/x86_64-linux-gnu/libsqlite3.so.0 (0x00007f08878d5000)
        libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f08877b5000)
        libreadline.so.8 => /lib/x86_64-linux-gnu/libreadline.so.8 (0x00007f088775e000)
        libassuan.so.0 => /lib/x86_64-linux-gnu/libassuan.so.0 (0x00007f0887748000)
        libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f0887720000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f088754b000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f0887407000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f08873e5000)
        libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f08873df000)
        libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x00007f08873b0000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f0887b64000)
root@pve:~#

Code:
root@pve:~# apt-key list
Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).
/etc/apt/trusted.gpg.d/debian-archive-bullseye-automatic.gpg
------------------------------------------------------------
pub   rsa4096 2021-01-17 [SC] [expires: 2029-01-15]
      1F89 983E 0081 FDE0 18F3  CC96 73A4 F27B 8DD4 7936
uid           [ unknown] Debian Archive Automatic Signing Key (11/bullseye) <ftpmaster@debian.org>
sub   rsa4096 2021-01-17 [S] [expires: 2029-01-15]

/etc/apt/trusted.gpg.d/debian-archive-bullseye-security-automatic.gpg
---------------------------------------------------------------------
pub   rsa4096 2021-01-17 [SC] [expires: 2029-01-15]
      AC53 0D52 0F2F 3269 F5E9  8313 A484 4904 4AAD 5C5D
uid           [ unknown] Debian Security Archive Automatic Signing Key (11/bullseye) <ftpmaster@debian.org>
sub   rsa4096 2021-01-17 [S] [expires: 2029-01-15]

/etc/apt/trusted.gpg.d/debian-archive-bullseye-stable.gpg
---------------------------------------------------------
pub   rsa4096 2021-02-13 [SC] [expires: 2029-02-11]
      A428 5295 FC7B 1A81 6000  62A9 605C 66F0 0D6C 9793
uid           [ unknown] Debian Stable Release Key (11/bullseye) <debian-release@lists.debian.org>

/etc/apt/trusted.gpg.d/debian-archive-buster-automatic.gpg
----------------------------------------------------------
pub   rsa4096 2019-04-14 [SC] [expires: 2027-04-12]
      80D1 5823 B7FD 1561 F9F7  BCDD DC30 D7C2 3CBB ABEE
uid           [ unknown] Debian Archive Automatic Signing Key (10/buster) <ftpmaster@debian.org>
sub   rsa4096 2019-04-14 [S] [expires: 2027-04-12]

/etc/apt/trusted.gpg.d/debian-archive-buster-security-automatic.gpg
-------------------------------------------------------------------
pub   rsa4096 2019-04-14 [SC] [expires: 2027-04-12]
      5E61 B217 265D A980 7A23  C5FF 4DFA B270 CAA9 6DFA
uid           [ unknown] Debian Security Archive Automatic Signing Key (10/buster) <ftpmaster@debian.org>
sub   rsa4096 2019-04-14 [S] [expires: 2027-04-12]

/etc/apt/trusted.gpg.d/debian-archive-buster-stable.gpg
-------------------------------------------------------
pub   rsa4096 2019-02-05 [SC] [expires: 2027-02-03]
      6D33 866E DD8F FA41 C014  3AED DCC9 EFBF 77E1 1517
uid           [ unknown] Debian Stable Release Key (10/buster) <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/proxmox-release-bookworm.gpg
---------------------------------------------------
pub   rsa4096 2022-11-27 [SC] [expires: 2032-11-24]
      F4E1 36C6 7CDC E41A E6DE  6FC8 1140 AF8F 639E 0C39
uid           [ unknown] Proxmox Bookworm Release Key <proxmox-release@proxmox.com>

/etc/apt/trusted.gpg.d/proxmox-release-bullseye.gpg
---------------------------------------------------
pub   rsa4096 2020-11-09 [SC] [expires: 2030-11-07]
      2813 9A2F 830B D684 78A1  A01F DD4B A391 7E23 BF59
uid           [ unknown] Proxmox Bullseye Release Key <proxmox-release@proxmox.com>

/etc/apt/trusted.gpg.d/proxmox-release-buster.gpg
-------------------------------------------------
pub   rsa4096 2018-11-19 [SC] [expires: 2028-11-16]
      3534 79F8 3781 D7F8 ED5F  5AC5 7BF2 812E 8A6E 88E0
uid           [ unknown] Proxmox Virtual Environment 6.x Release Key <proxmox-release@proxmox.com>

/usr/bin/apt-key: 59: rm: not found
root@pve:~#


Please let me know if there is anything else I can provide. Thanks for the help.
 
/usr/bin/apt-key: 59: rm: not found
Well, that seems like the root cause. This is a fundamental command and should never be not present.
What do which rm and apt info coreutils report?

Did you remove some packages or delete some files from the system?
 
  • Like
Reactions: Never_knows_best
I was wondering about that last line. It seemed to be the only thing out of place, but again I am not a linux expert. As for your questions:

which rm
Code:
root@pve:~# which rm
root@pve:~#

apt info coreutils
Code:
root@pve:~# apt info coreutils
Package: coreutils
Version: 8.32-4+b1
Priority: required
Essential: yes
Section: utils
Source: coreutils (8.32-4)
Maintainer: Michael Stone <mstone@debian.org>
Installed-Size: 17.9 MB
Pre-Depends: libacl1 (>= 2.2.23), libattr1 (>= 1:2.4.44), libc6 (>= 2.28), libgmp10, libselinux1 (>= 3.1~)
Homepage: http://gnu.org/software/coreutils
Tag: admin::configuring, implemented-in::c, interface::commandline,
 role::program, scope::utility, suite::gnu, works-with::file
Download-Size: 2,867 kB
APT-Manual-Installed: yes
APT-Sources: http://ftp.us.debian.org/debian bullseye/main amd64 Packages
Description: GNU core utilities
 This package contains the basic file, shell and text manipulation
 utilities which are expected to exist on every operating system.
 .
 Specifically, this package includes:
 arch base64 basename cat chcon chgrp chmod chown chroot cksum comm cp
 csplit cut date dd df dir dircolors dirname du echo env expand expr
 factor false flock fmt fold groups head hostid id install join link ln
 logname ls md5sum mkdir mkfifo mknod mktemp mv nice nl nohup nproc numfmt
 od paste pathchk pinky pr printenv printf ptx pwd readlink realpath rm
 rmdir runcon sha*sum seq shred sleep sort split stat stty sum sync tac
 tail tee test timeout touch tr true truncate tsort tty uname unexpand
 uniq unlink users vdir wc who whoami yes

root@pve:~#

As for removing packages or deleting files, there are none that I can recall. I usually go into the gui and update the system every few weeks, and it always worked. I followed the instructions in the https://forum.proxmox.com/threads/opt-in-linux-6-1-kernel-for-proxmox-ve-7-x-available.119483/ thread, and it seemed to install fine. I have looked in the /usr/bin dir and apt-key is present. Am I reading that error wrong?
 
Last edited:
The rm command seems to really be missing from the system.

Can you try running apt install --reinstall coreutils?
This should forcibly reinstall the coreutils package and hopefully restore the rm command.
 
  • Like
Reactions: Never_knows_best
Well damn, I tried, but it was angry that rm wasn't present (Catch-22 it seems). I am wondering if I can get a copy from a different install moved over and then do the reinstall of coreutils, unless you have any other ideas. Or maybe just do a reinstall of the system would be best since it seems some weirdness happened somewhere.

Code:
root@pve:/usr/bin# apt install --reinstall coreutils
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libzpool4linux pve-kernel-5.11.22-5-pve
Use 'apt autoremove' to remove them.
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/2,867 kB of archives.
After this operation, 0 B of additional disk space will be used.
dpkg: warning: 'rm' not found in PATH or not executable
dpkg: error: 1 expected program not found in PATH or not executable
Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin
E: Sub-process /usr/bin/dpkg returned an error code (2)
root@pve:/usr/bin#
 
Well, I went ahead and copied rm from my ubuntu server install and then did a coreutil reinstall, and everything is working now. I am not sure how rm was removed from the system, but at least it is working. Thank you for your help, it is greatly appreciated. Thanks to you, I now know some new to me trouble shooting queries.
 
  • Like
Reactions: cheiss