Ubuntu – How to cleanly remove a badly installed .deb

aptdpkgpackage-managementuninstall

Whenever I try to use dpkg or apt-get, I get the warning:

dpkg: warning: parsing file '/var/lib/dpkg/available' near line 12674 package 'jarnal':
 error in Version string 'build901': version number does not start with digit

Looking at the /var/lib/dpkg/available file, I find the entry

Package: jarnal
Priority: optional
Section: non-free
Maintainer: David K. Levine <david@dklevine.com>
Architecture: all
Version: build901
Depends: sun-java5-jre | sun-java6-jre
Recommends: sun-jai, sun-jai-imageio
Size: 11217466
Description: a Java Notetaker and PDF Annotator... <snip>

which corresponds to the /DEBIAN/control file in jarnal-build918_all.deb.
I installed this package about a year ago (before upgrading to 11.04), but can not remove it using apt or dpkg or various frontends.

locate find files installed in /usr/lib/jarnal/, but it looks incomplete – I think it might be a failed uninstall – since I remember playing with it once, so it must have been properly installed at some point.

Anyway, how can I cleanly remove both the files and the data stored by apt/dpkg from my system?

Best Answer

You can back up the available file and then empty it (leave it there, but empty).

apt-get doesn't need the file at all, dpkg sometimes uses it for reference, but it's not essential and it will populate it again after some time.

Another option would be to delete the problematic jarnal entry from the available file manually.

Related Question