This morning, like every morning for the last years, I tried to do
sudo apt-get update && apt-get upgrade
for my WSL with Debian 12 bookworm.
However, the following was returned:
Hit:1 http://deb.debian.org/debian bookworm InRelease
Hit:2 http://deb.debian.org/debian bookworm-updates InRelease
Hit:3 http://deb.debian.org/debian-security bookworm-security InRelease
Hit:4 https://dl.yarnpkg.com/debian stable InRelease
Reading package lists... Done
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
.. running sudo dpkg --configure -a
results in:
dpkg: error: error installing new file '/var/lib/dpkg/status': Permission denied
I looked around and (among other things) tried the following to no avail:
sudo rm -fr /var/cache/apt
sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bak
sudo touch /var/lib/dpkg/status
sudo apt clean
sudo apt update && sudo apt upgrade
E: dpkg was interrupted, you must manually run 'sudo dpkg --configure -a' to correct the problem.
I also rebooted, and restarted WSL. Both had no effect. Any other ideas?