[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [SOLVED] Problem removing packages when their uninstall procedures fail



To Gabriel Parrondo <nqtnn.gabo@gmail.com>: I saw your suggestion in
the man page. It says: "Note  that  this will not actually install or
remove anything, but just set the selection state on the requested
packages.". My problem isn't the state of the packages, so it didn't
solve the problem.

To thierry <tchatelet@free.fr>: -e parameter is just to extract
control file information. I couldn't find anywhere an example of being
used to alter the control file execution during uninstallation.

I thought the skipping the control file execution is just some
parameter I am missing, but since this doesn't seem to be the case, I
decided to touch the database itself. I was suprised to see that this
is just a flat file.

So, I did the following:
1) Removed every file of the package. dpkg -L broken-package | xargs rm
2) Opened /var/lib/dpkg/status, found the package and deleted every
line until the next blank line.

That did what I wanted to do.

Thank you all for your quick responses and suggestions.


Regards
--
Giannis Stoilis


On 1/15/06, thierry <tchatelet@free.fr> wrote:
> Gabriel Parrondo wrote:
>
> > Giannis Stoilis wrote:
> >
> >> Hello,
> >>
> >> I have a broken debian package from a third party vendor which I want
> >> to uninstall from a debian sarge system.
> >>
> >> Unfortunately, the package demands to run a buggy script prior to
> >> uninstalling, which always fails, thus blocking the uninstallation
> >> procedure.
> >>
> >> I want to remove this package completely from the package manager's
> >> database without caring whether its prerm script fails, no matter the
> >> consequenses. I could remove each file from the package by hand, but
> >> that still leaves me with a corrupted dpkg database, blocking me from
> >> using the package manager.
> >>
> >> Using "dpkg -r --force-all" doesn't seem to do the trick.
> >>
> >> Is there another way to force an uninstallation of a broken package?
> >> Is there a solution I am missing? Could you point me in the right
> >> direction as to what to do? Any help will be greatly appreciated.
> >>
> >>
> > There's more than one solution:
> >
> > For the first one, we need to know which script is failing, why, and
> > try to fix it (no good).
> > To do it you should send the output when you try you uninstall the
> > package.
> >
> >
> >
> >
> > For the second one, you can use dpkg --get-selection and dpkg
> > --set-selections for rebuilding de dpkg database.
> > First, you do
> >
> > dpkg --get-selections > selections.txt
> >
> > then you edit selections.txt and delete the line containing this
> > package. And then you do:
> >
> > dpkg --set-selections < selections.txt
> >
> > Then you just delete the files installed by the package and the
> > package itself.
> >
> > I don't really know if it works since I never did it, but in theory it
> > should.
> >
> >
> >
> Hi,
> There is something on the net about removing a line with a "-e" in the
> post-install and pre-install files of the faulty package. I remember I
> had to google quiet a lot to find that, and unfortunatly I hav'nt kept a
> trace of it. But at least you have a pointing direction
> Thierry

Reply to: