Ubuntu – How to recreate /var/lib/dpkg/status


When I run sudo apt update in Ubuntu 18.10 I get this error message:

E: flAbsPath on /var/lib/dpkg/status failed - realpath (2: No such file or directory)
E: Could not open file  - open (2: No such file or directory)
E: Problem opening 
E: The package lists or status file could not be parsed or opened.

After running sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status it's showing this error message:

cp: cannot stat '/var/lib/dpkg/status-old': No such file or directory 

Best Answer

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
Related Question