I'm trying to perform apt-update on ubuntu 22.04 LTS and I get an error
root@kisharra:~# apt updateHit:1 http://apt.postgresql.org/pub/repos/apt jammy-pgdg InReleaseHit:2 http://ru.archive.ubuntu.com/ubuntu jammy InReleaseGet:3 http://ru.archive.ubuntu.com/ubuntu jammy-updates InRelease [119 kB]Get:4 http://security.ubuntu.com/ubuntu jammy-security InRelease [110 kB]Err:2 http://ru.archive.ubuntu.com/ubuntu jammy InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93CHit:5 http://ru.archive.ubuntu.com/ubuntu jammy-backports InReleaseErr:3 http://ru.archive.ubuntu.com/ubuntu jammy-updates InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93CErr:5 http://ru.archive.ubuntu.com/ubuntu jammy-backports InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93CErr:4 http://security.ubuntu.com/ubuntu jammy-security InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93CFetched 229 kB in 2s (140 kB/s)Reading package lists... DoneBuilding dependency tree... DoneReading state information... Done2 packages can be upgraded. Run 'apt list --upgradable' to see them.W: http://apt.postgresql.org/pub/repos/apt/dists/jammy-pgdg/InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for 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://ru.archive.ubuntu.com/ubuntu jammy InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93CW: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ru.archive.ubuntu.com/ubuntu jammy-updates InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93CW: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://ru.archive.ubuntu.com/ubuntu jammy-backports InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93CW: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: http://security.ubuntu.com/ubuntu jammy-security InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93CW: Failed to fetch http://ru.archive.ubuntu.com/ubuntu/dists/jammy/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93CW: Failed to fetch http://ru.archive.ubuntu.com/ubuntu/dists/jammy-updates/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93CW: Failed to fetch http://ru.archive.ubuntu.com/ubuntu/dists/jammy-backports/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93CW: Failed to fetch http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 871920D1991BC93CW: Some index files failed to download. They have been ignored, or old ones used instead.
As you can see, 4 packages were not updated due to the lack of PUBKEY 871920D1991BC93C
but if you look at the output of the apt-key list
command, it is there
root@kisharra:~# apt-key listWarning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8))./etc/apt/trusted.gpg--------------------pub rsa4096 2012-05-11 [SC] 790B C727 7767 219C 42C8 6F93 3B4F E6AC C0B2 1F32uid [ unknown] Ubuntu Archive Automatic Signing Key (2012) <ftpmaster@ubuntu.com>pub rsa4096 2011-10-13 [SC] B97B 0AFC AA1A 47F0 44F2 44A0 7FCC 7D46 ACCC 4CF8uid [ unknown] PostgreSQL Debian Repository/etc/apt/trusted.gpg.d/ubuntu-keyring-2012-cdimage.gpg------------------------------------------------------pub rsa4096 2012-05-11 [SC] 8439 38DF 228D 22F7 B374 2BC0 D94A A3F0 EFE2 1092uid [ unknown] Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>/etc/apt/trusted.gpg.d/ubuntu-keyring-2018-archive.gpg------------------------------------------------------pub rsa4096 2018-09-17 [SC] F6EC B376 2474 EDA9 D21B 7022 8719 20D1 991B C93Cuid [ unknown] Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>/etc/apt/trusted.gpg.d/ubuntu.lafibre.info.gpg----------------------------------------------pub rsa4096 2018-09-17 [SC] F6EC B376 2474 EDA9 D21B 7022 8719 20D1 991B C93C ^^^^^^^^^^^^^^^^^^^uid [ unknown] Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>
this command outputs the following
root@kisharra:~# apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93CWarning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).Executing: /tmp/apt-key-gpghome.LfbmJQ2SFz/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 871920D1991BC93Cgpg: key 871920D1991BC93C: "Ubuntu Archive Automatic Signing Key (2018) <ftpmaster@ubuntu.com>" not changedgpg: Total number processed: 1gpg: unchanged: 1
after using this command
root@kisharra:~# gpg --export --armor 871920D1991BC93C | sudo apt-key add -Warning: apt-key is deprecated. Manage keyring files in trusted.gpg.d instead (see apt-key(8)).OK
tried to update the packages again and same error, if anyone has any ideas, please help