[Lilug] Fun with debian packages

Chris Knadle Chris.Knadle at coredump.us
Sat Feb 14 06:57:55 PST 2009


On Saturday 14 February 2009, Kenneth Downs wrote:
> Chris Knadle wrote:
> > On Friday 13 February 2009, Kenneth Downs wrote:
> >> I'm experimenting with a debian package on a virtual machine,
> >> and have managed to get to the state where nothing can be
> >> installed until this package is removed, but the package cannot
> >> be removed because it cannot find an archive for it.
> >>
> >> I'd like to learn something here, which is how to tell ubuntu to
> >> get rid of the package even if it cannot find an archive?
> >
> > sudo dpkg -P <package name>
> >
> > I've loaded plenty of packages that have no online archives for
> > them -- it's not required for a package to have an archive in
> > order to install or remove it.
> >
> >   -- Chris
>
> Quoth Ubuntu:
>
>  Package is in a very bad inconsistent state - you should
>  reinstall it before attempting a removal.
> Errors were encountered while processing:
>   test

Okay -- you have a different problem.  It again has nothing to do with 
having an archive for the package or not.  In this case what I 
believe has happened is that the package has _failed_ to install 
because something has gone wrong with the install script (postinst), 
and it is _also_ failing to uninstall because something has gone 
wrong with the uninstall script (postrm).  So the Debian package 
system is in an inconsistent state and has been left in a broken 
state.

The way to manually fix this is to modify the package's postinst or 
postrm script directly by modifying /var/lib/dpkg/info/test.postinst 
or /var/lib/dpkg/info/test.postrm so that one of them can complete 
the install or remove operation -- i.e. the files that have been 
inflated from your package onto the system.

You might want to install and use 'lintian' or another Debian package 
checker first so you that you can catch issues with your package 
before you try installing it.  And for making virtual packages that 
contain no actual files, have a look at the 'equivs' package.

  -- Chris

-- 

Chris Knadle
Chris.Knadle at coredump.us



More information about the Lilug mailing list