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 πŸ˜›


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s