apt-get how to fix very broken packages

I recently upgraded from Ubuntu 8.04.3 to Ubuntu 10.04 and things went well, except a few broken packages.

Apt-get / synaptic was very broken due to the flashplugin-nonfree.

sudo apt-get install -f
[clip]
dpkg: error processing flashplugin-nonfree (--remove):
Package is in a very bad inconsistent state – you should
reinstall it before attempting a removal.
Errors were encountered while processing:
flashplugin-nonfree
E: Sub-process /usr/bin/dpkg returned an error code (1)

sudo dpkg --configure -a
dpkg: dependency problems prevent configuration of realplayer:
realplayer depends on libstdc++5 (>= 1:3.3.4-1); however:
Package libstdc++5 is not installed.
dpkg: error processing realplayer (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
realplayer

Not looking very good … and forcing things did not help (same results with --remove --force-remove-reinstreq.


dpkg --remove --force-all flashplugin-nonfree
dpkg: warning: overriding problem because --force enabled:
Package is in a very bad inconsistent state - you should
reinstall it before attempting a removal.
(Reading database ... 239938 files and directories currently installed.)
Removing flashplugin-nonfree ...
update-alternatives: error: no alternatives for iceape-flashplugin.
update-alternatives: error: no alternatives for iceape-flashplugin.
dpkg: error processing flashplugin-nonfree (--remove):
subprocess installed pre-removal script returned error exit status 2
postinst called with argument `abort-remove'
dpkg: error while cleaning up:
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
flashplugin-nonfree

To fix the problem I needed to manually remove the package.

cd /var/lib/dpkg/info
sudo rm flashplugin-nonfree.*

Now remove the offending packages:

sudo dpkg --remove --force-remove-reinstreq flashplugin-nonfree
sudo dpkg --remove --force-remove-reinstreq realplayer

VoilĂ  – apt-get is now fixed =)

This entry was posted in Linux. Bookmark the permalink.

54 Responses to apt-get how to fix very broken packages

  1. bodhi.zazen says:

    @Markus – You are most welcome

  2. news article says:

    I am usually to running a blog and i actually recognize your content. The article has really peaks my interest. I’m going to bookmark your web site and keep checking for new information.

  3. Pingback: Fixing very broken packages in apt-get | Tidbits from the Web

  4. Pingback: On breaking ubuntu apt-get and recovering | BASHful muse

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>