Skip to content

Instantly share code, notes, and snippets.

@Luro02
Last active February 10, 2019 09:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Luro02/3d7c290c3d1fd095ce1d0e313a4e2b29 to your computer and use it in GitHub Desktop.
Save Luro02/3d7c290c3d1fd095ce1d0e313a4e2b29 to your computer and use it in GitHub Desktop.
A little tutorial for future ubuntu users, that have a fucked up apt/dpkg database and want to fix it

The Problem:

After some time the package database might get broken because you installed some incomplete stuff or did some installations manually, without thinking what you were doing. Now you get a warning everytime you run an apt-command, or even worse: it refuses to install anything.

How I fixed it:

run the following commands:

sudo bash

mv /var/lib/dpkg/status /var/lib/dpkg/status_bkup

sudo touch /var/lib/dpkg/status

sudo apt update && sudo apt upgrade

sudo apt dist-upgrade

and that worked for me :3

You should now run the following command to make all updates:

sudo apt-get update && sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y && sudo apt-get autoremove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment