3

A little background first...

Installed Ubuntu 20.04.2 LTS (GNU/Linux 5.4.0-1029-raspi aarch64) on Raspberry Pi 4. (This is not a docker container.) Made sure locale and system clock were set up correctly first. Got the latest updates from apt. Installed both PiHole and PiVPN via their online scripts. Made sure unattended-upgrades was properly set up for just security updates. Everything is working perfectly for weeks.

Today, I randomly went to check the PiHole web admin and was greeted with a 500 internal server error. SSH in to the RPi and was just going to try rebooting but decided to run apt and look for updates first. Now that we're all caught up, here's the commands I've used followed by their output. Any help would be much appreciated. Only things I could find are specific to docker containers and one other post here that seems to be pretty much the same problem but never got a single reply from anyone. Hoping I'm not as unlucky.

NOTE: To avoid looking like spam I've replaced all the URLs with < URL >. They're all originally http://ports.ubuntu.com/ubuntu-ports.

sudo apt update

Hit:1 <URL> focal InRelease Get:2 <URL> focal-updates InRelease [114 kB] Err:1 <URL> focal InRelease Unknown error executing apt-key Get:3 <URL> focal-backports InRelease [101 kB] Err:2 <URL> focal-updates InRelease Unknown error executing apt-key Get:4 <URL> focal-security InRelease [109 kB] Err:3 <URL> focal-backports InRelease Unknown error executing apt-key Err:4 <URL> focal-security InRelease Unknown error executing apt-key Fetched 324 kB in 1s (221 kB/s) Reading package lists... Error! W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: <URL> focal 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: <URL> focal-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: <URL> focal-backports 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: <URL> focal-security InRelease: Unknown error executing apt-key W: Failed to fetch <URL>/dists/focal/InRelease Unknown error executing apt-key W: Failed to fetch <URL>/dists/focal-updates/InRelease Unknown error executing apt-key W: Failed to fetch <URL>/dists/focal-backports/InRelease Unknown error executing apt-key W: Failed to fetch <URL>/dists/focal-security/InRelease Unknown error executing apt-key W: Some index files failed to download. They have been ignored, or old ones used instead. E: Encountered a section with no Package: header E: Problem with MergeList /var/lib/apt/lists/ports.ubuntu.com_ubuntu-ports_dists_focal_universe_i18n_Translation-en E: The package lists or status file could not be parsed or opened.

sudo apt clean sudo apt-get clean sudo mv /var/lib/apt/lists /tmp sudo mkdir -p /var/lib/apt/lists/partial sudo apt clean sudo apt update

Get:1 <URL> focal InRelease [265 kB] Get:2 <URL> focal-updates InRelease [114 kB] Get:3 <URL> focal-backports InRelease [101 kB] Err:1 <URL> focal InRelease Unknown error executing apt-key Get:4 <URL> focal-security InRelease [109 kB] Err:2 <URL> focal-updates InRelease Unknown error executing apt-key Err:3 <URL> focal-backports InRelease Unknown error executing apt-key Err:4 <URL> focal-security InRelease Unknown error executing apt-key Reading package lists... Done W: GPG error: <URL> focal InRelease: Unknown error executing apt-key E: The repository '<URL> focal 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: GPG error: <URL> focal-updates InRelease: Unknown error executing apt-key E: The repository '<URL> focal-updates 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: GPG error: <URL> focal-backports InRelease: Unknown error executing apt-key E: The repository '<URL> focal-backports 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: GPG error: <URL> focal-security InRelease: Unknown error executing apt-key E: The repository '<URL> focal-security 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.

2 Answers2

0

In my case, the cat file was destroyed. When recover cat, apt also becomes normal.

0

Try sudo ldconfig /usr/bin/gpg. See: https://unix.stackexchange.com/a/677711/114401

It worked for me. sudo apt update now works again.