Fix broken package in Ubuntu

This problem is too common, sometimes we have some partial downloaded packages that stuck in our apt-get package manager and create troubles for us.

To do this try these commands and see if any works for your case:

1) You can delete the lock file with the following command: 
$sudo rm /var/lib/apt/lists/lock
You may also need to delete the lock file in the cache directory
$sudo rm /var/cache/apt/archives/lock

2) $sudo apt-get clean && sudo apt-get update
3) $sudo apt-get update --fix-missing
4) $sudo dpkg --configure -a
5) $sudo apt-get install -f

6) If above command does not work then open /var/lib/dpkg/status file and remove the blocks of packages that were creating trouble for you.

6th point was new for me thats why I wrote this post 😛



Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.