I don’t know if this happens to everyone often, but I usually screw up the Synaptic Package Manager in my computer very often. Most often, there errors are due to some stupid packages that don’t get installed properly or have some compatibility issues with other installed packages.

The most grave error is this:

sahasranaman@sahasranaman-desktop:~$ sudo apt-get install flock
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package awcommon needs to be reinstalled, but I can’t find an archive for it.

When apt-get or Synaptic Package Manager gives this error, I would always have to reinstall Ubuntu because there is no direct way to correct this. A few days ago, I came across this hack to correct all package related errors in Synaptic Package Manager.

There is a file in Debian based Operating Systems called /var/lib/dpkg/status that stores a list of all installed packages. It is a text file in Human-Readable format. All you have to do is to remove the entry of the software package that is causing trouble from the list. Here’s a step by step procedure that can help you solve the problem:

  • Press Alt + F2 to open the “Run Command” dialog box.
  • In the Run Command dialog box, type gksu gedit /var/lib/dpkg/status and hit Enter.
  • Type your password when asked. This step opens the package list in a text editor.
  • In the text editor, look for the package that is causing the trouble. Press Ctrl + F to find the package that you want to remove
  • Once you find the entry of that particular package, remove it completely.

For example, if I want to remove a package called finger, I start removing from the line

Package: finger

and remove all lines upto the start of the next Package entry.

I’m not sure if this is the best way to solve such problems, because what we actually do here is remove the entry from the list of packages installed without actually uninstalling it, but it does the trick anyway.

del.icio.us Digg DZone IndianPad Newsgator reddit Simpy SlashDot StumbleUpon Technorati


One Comment to “Correcting Errors in Synaptic Package Manager”

  1. hendoc | June 28th, 2008 at 5:05 am

    Thanks for the tip.

Leave a Comment