Can't install/remove/upgrade any package

Sometimes a corrupt installation package can corrupt your package management system leaving your Linux unable to install or on remove any packages (Software). Here is the message error I got from apt-get after trying to install ndas-admin for Ubuntu.

$sudo apt-get install mplayer (or any package) Reading package lists… Done Building dependency tree
Reading state information… Done E: The package ndas-admin needs to be reinstalled, but I can’t find an archive for it. (this is the error)

I tried sudo apt-get install -f to try to fix the problem but got the same error. The only option I had was to edit the dpkg status file manually.

$ sudo gedit /var/lib/dpkg/status    (if you prefer you can use vi instead of gedit)
Locate the corrupt package, and remove the whole block of information about it and save the file. Mine looked like this:

Package: ndas-admin
Status: deinstall reinstreq half-configured
Priority: extra
Section: alien
Installed-Size: 100
Maintainer: root <root@ubuntu510>
Architecture: i386
Version: 1.0.2-24
Depends: libc6 (>= 2.3.4-1)
Description: Administration toosl for XIMETA,Inc NDAS device driver for Linux operating system
 ndas-admin – This program allows the user to register/enable/disable/unregister the XIMETA NDAS hard disk.
 .
 (Converted from a rpm package by alien version 8.53.)

Fixed. Hope this helps someone else.


Here is what worked for me:

sudo dpkg --force-all -r ubuntu-docs

I'll report if anything goes wrong about it again. BTW solution was posted at How to get dpkg working again?

Ohh yea word of advice: Now I need to use Synaptic to update system everytime -- cause ubuntu-docs is in every update and I need to untick it :-/. Guess I'll start other question to ask how to remove particular package from every subsequent update.