Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

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

Writer Sebastian Wright

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 
3

2 Answers

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
1

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy