Unable to install any updates through update manager/apt-get upgrade
I have fixed the problem with these instructions.
So the solution is the following:
- Go into the
/var/lib/dpkg
directory- Make a backup of the
status
file- Edit the
status
file- Search the package that gave the error
Just delete the lines from this package (but let all other lines that concern other packages even if they contains the broken package in their "Replaces" or "Depends" fields)
[…]
Save changes in the
status
file- Run:
sudo dpkg --configure -a
Force the re-installation of missing dependencies (because now, there are some):
sudo apt-get -f install
I think that if the broken package does not depend on any other package (could be rare), just reinstall it:
sudo apt-get install the_package
Everything is fine now can update, upgrade, or install new packages!
It should be noted that I had a few differences to the solution given there. The status file was not easy to edit (as it is an important file and never meant to be edited). Any edits made there should be done with care, and the file should be backed up before you make any changes.
I had to repeat steps 4-8 three times (each time the error would be the same just with a different package). Finally when all the packages were removed, I was able to reinstall them, and it fixed my problem.
It can happen that the disk is corrupted with inodes.
With a live CD, run this command
sudo fdisk -l
note the disk and partition, it could be /dev/dsb1
then repair it:
sudo fsck -y /dev/sdb1
Reboot, and return on the system
sudo apt-get -f install
sudo apt-get update
sudo apt-get upgrade