How to recreate /var/lib/dpkg/status?

Run the following commands:

sudo mkdir -p /var/lib/dpkg/{alternatives,info,parts,triggers,updates}
sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status
sudo apt-get download dpkg
sudo dpkg -i dpkg*.deb
sudo apt-get download base-files
sudo dpkg -i base-files*.deb
sudo apt-get update
sudo apt-get check

Restore the /var/lib/dpkg/status file from its backup file (/var/lib/dpkg/status-old). Open the terminal and type:

sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status  

Then run sudo apt update again.


If that doesn't work run the following commands:

sudo touch /var/lib/dpkg/status  
sudo apt update && sudo apt upgrade
sudo reboot  
sudo apt full-upgrade