From: Zico on
Hi,

After upgrading from Ubuntu 8.04 to 10.04, the package management
system seems to have become irreparably damaged; the package
flashplugin-nonfree fails, and I can not remove it, upgrade it,
nothing.

I'm trying the standard repair commands, but no effect.

When I do an upgrade (either apt-get upgrade flashplugin-nonfree
or with dpkg), I get the following:

dpkg: error processing flashplugin-nonfree (--remove):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.

Here are some of the commands I tried --- they all failed,
with more or less the same error message.

dpkg --remove --force-remove-reinstreq flashplugin-nonfree
dpkg --purge --force-remove-reinstreq flashplugin-nonfree

apt-get -f install flashplugin-nonfree
apt-get -f install

dpkg --configure -a
dpkg-reconfigure -a

At some point, I tried removing the lock file, /var/lib/dpkg/lock,
but it didn't seem to make any difference.

Any way to handle this?

Notice that the system works, but it is effectively broken, since
I can not do *anything at all* that involves installation or upgrade;
can't install any new software, can't remove anything, can't
apply security upgrades, etc.

Thanks,
-Zico
From: The Natural Philosopher on
Zico wrote:
> Hi,
>
> After upgrading from Ubuntu 8.04 to 10.04, the package management
> system seems to have become irreparably damaged; the package
> flashplugin-nonfree fails, and I can not remove it, upgrade it,
> nothing.
>
> I'm trying the standard repair commands, but no effect.
>
> When I do an upgrade (either apt-get upgrade flashplugin-nonfree
> or with dpkg), I get the following:
>
> dpkg: error processing flashplugin-nonfree (--remove):
> Package is in a very bad inconsistent state - you should
> reinstall it before attempting a removal.
>
> Here are some of the commands I tried --- they all failed,
> with more or less the same error message.
>
> dpkg --remove --force-remove-reinstreq flashplugin-nonfree
> dpkg --purge --force-remove-reinstreq flashplugin-nonfree
>
> apt-get -f install flashplugin-nonfree
> apt-get -f install
>
> dpkg --configure -a
> dpkg-reconfigure -a
>
> At some point, I tried removing the lock file, /var/lib/dpkg/lock,
> but it didn't seem to make any difference.
>
> Any way to handle this?
>
> Notice that the system works, but it is effectively broken, since
> I can not do *anything at all* that involves installation or upgrade;
> can't install any new software, can't remove anything, can't
> apply security upgrades, etc.
>
> Thanks,
> -Zico

I've usually got out of that using synaptic to totally remove offending
packages, or as a last resort, a fresh install over the existing..you
should keep most of the system settings..should..
From: Zico on

> I've usually got out of that using synaptic to totally remove offending
> packages, or as a last resort, a fresh install over the existing..you
> should keep most of the system settings..should..

Well, Synaptic won't even run (I imagine all it does is act as a
front-end for apt-get, or maybe aptitude, or maybe dpkg??), which
is why I tried all these CLI alternatives.

But I'm curious about the option of "fresh install over the existing".
How would that even work, if none of the package management
tools allow me to do *anything* (install, upgrade, or remove *any*
package).

I wonder if there's any way to "manually" go and erase or edit files
that control the package database and that are the ones broken?

Thanks,
-Zico

From: The Natural Philosopher on
Zico wrote:
>> I've usually got out of that using synaptic to totally remove offending
>> packages, or as a last resort, a fresh install over the existing..you
>> should keep most of the system settings..should..
>
> Well, Synaptic won't even run (I imagine all it does is act as a
> front-end for apt-get, or maybe aptitude, or maybe dpkg??), which
> is why I tried all these CLI alternatives.
>
> But I'm curious about the option of "fresh install over the existing".
> How would that even work, if none of the package management
> tools allow me to do *anything* (install, upgrade, or remove *any*
> package).
>
> I wonder if there's any way to "manually" go and erase or edit files
> that control the package database and that are the ones broken?
>

yes, but its dangerous.

apt-get purge <package> is a place to start
apt-get purge <package> --force-yes

is a bit more demanding. and will ignore dependencies.


What I was thinking was that as a last resort, shove the installation CD
in the machine and reinstall the basics, do the distro upgrade, and then
reinstall the packages you need.


> Thanks,
> -Zico
>
From: Zico on

> > I wonder if there's any way to "manually" go and erase or edit files
> > that control the package database and that are the ones broken?
>
> yes, but its dangerous.
>
> apt-get purge <package> is a place to start
> apt-get purge <package>  --force-yes
>
> is a bit more demanding. and will ignore dependencies.

But as it turns out, it is just a "front-end" for dpkg.

When I run either one of these commands, I again get:

dpkg: error processing flashplugin-nonfree (--purge):
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.

> What I was thinking was that as a last resort, shove the installation CD
> in the machine and reinstall the basics, do the distro upgrade, and then
> reinstall the packages you need.

Ooohhh :-( But that would be extremely inconvenient,
wouldn't it?? (I mean, I would lose pretty much everything,
all the settings).

Although maybe, I could rather do a fresh install *of the
newer* version (i.e., do a CD install of 10.04). Given
that the settings and config files have been already
"adapted" --- during the upgrade from 8.04 to 10.04 ---
now I would only have to tell the installation to keep the
existing home directory of the user. (am I right?)

Now that I re-read your comment --- maybe that is
exactly what you meant? (at first read, I thought you
meant reinstall 8.04, do the upgrade to 10.04, then
reinstall any extra stuff?)

Thanks,
-Zico