Remov­ing adobe-flashplugin

Today I’ve made one mis­take. I’ve installed on my Debian squeeze/sid a pack­age install_flash_player_10_linux.deb from Adobe™ and now I can’t neither remove it nor use it.  So, when I try to ‘apt-get remove flashplayer-mozilla‘ I receive an error:

ixti@msi-s300:~$ sudo apt-get remove flashplayer-mozilla
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: The package adobe-flashplugin needs to be reinstalled, but I can't find an archive for it.

Even try­ing to remove it with ‘dpkg --force-all --remove adobe-flashplugin‘ throws an error:

ixti@msi-s300:~$ sudo dpkg --force-all --remove adobe-flashplugin
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 ... 363405 files and directories currently installed.)
Removing adobe-flashplugin ...
update-alternatives: error: no alternatives for iceape-flashplugin.
update-alternatives: error: no alternatives for iceape-flashplugin.
dpkg: error processing adobe-flashplugin (--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:
adobe-flashplugin

After 15 minutes of googling I found a solu­tion on rus­sian for­ums: Lafox.NET and LinuxForum.RU. So for those of you who are not famil­iar with rus­sian lan­guage I’m proud to explain the solution.

The prob­lem is that this pack­age was built ONLY for Ubuntu. And before remov­ing itself it tries to execute pre-remove action on every pack­age lis­ted in VARIANTS vari­able of /var/lib/dpkg/info/adobe-flashplugin.prerm. So all we need to do is to com­ment out that vari­able. So after you will com­ment out it you’ll be able to remove it, e.g. with ‘dpkg --force-all --remove adobe-flashplugin‘:

ixti@msi-s300:~$ sudo dpkg --force-all --remove adobe-flashplugin
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 ... 363405 files and directories currently installed.)
Removing adobe-flashplugin ...
dpkg: warning: while removing adobe-flashplugin, directory '/usr/lib/adobe-flashplugin' not empty so not removed.

UPD [28 Nov 2009]: As Joseph men­tioned in com­ments, some­times this solu­tion does not help. So in fact the easi­est way to “force” removal of plu­gin is to “dis­able” APT’s pre-rm requis­i­tions by simple renam­ing it:

# mv /var/lib/dpkg/info/adobe-flashplugin.prerm /var/lib/dpkg/info/adobe-flashplugin.prerm-DISABLED

But don’t for­get to remove adobe-flashplugin.prerm-DISABLED manu­ally once pack­age was removed.

  • del.icio.us
  • Google Bookmarks
  • Identi.ca
  • Twitter
  • Technorati
  • Digg
  • Slashdot
  • Facebook
  • MisterWong
  • Reddit
  • StumbleUpon
  • Mixx
  • HelloTxt
  • LinkedIn
  • PDF
  • email
  • Print
This entry was posted in Debian GNU/Linux and tagged , , . Bookmark the permalink.

16 Responses to Remov­ing adobe-flashplugin

  1. Thomas F says:

    Thanks so much. This was a bet­ter solu­tion than all 5 top posts on google. Your fix was the quick­est, and easiest.

    Thanks again..

  2. frederic triquet says:

    thanks a lot !!!

  3. Martin says:

    Thank you very much. This was easy and fast help.

  4. Matthew says:

    Yeah! You rule!

  5. jess says:

    +1 Yes! Thank you very much.

  6. Terry says:

    Cool, this fixed the cor­rup­ted dpkg data­base status issue for me. Thanks!

  7. adam says:

    dpkg –force-all –remove adobe-flashplugin
    dpkg: oper­a­tion requires read/write access to dpkg status area

    That what i get When i put in your last com­mand in ter­minal Please HELP!!!

  8. ixti says:

    @adam:

    Seems like your dpkg status area is locked by another pro­cess (e.g. apt-get or aptitude installing/updating/removing) or you don’t have rights. You have to run it with root priv­ileges. If you still hav­ing prob­lems, you can con­tact me via xmpp:zapparov@jabber.ru or via irc:ixti@freenode.net

  9. Ali says:

    How to run with root priv­ileges? have same prob­lem as Adam…
    thanks

  10. Carlo says:

    Won­der­ful!
    Really Really Thank You!

  11. Joseph says:

    Thanks for the post. On my Debian test­ing install, I wasn’t able to fix this prob­lem immediately:

    # dpkg –force-all –remove adobe-flashplugin
    dpkg: warn­ing: over­rid­ing prob­lem because –force enabled:
    Pack­age is in a very bad incon­sist­ent state — you should
    rein­stall it before attempt­ing a removal.
    (Read­ing data­base … 142017 files and dir­ect­or­ies cur­rently installed.)
    Remov­ing adobe-flashplugin …
    update-alternatives: error: no altern­at­ives for iceape-flashplugin.
    update-alternatives: error: no altern­at­ives for iceape-flashplugin.
    dpkg: error pro­cessing adobe-flashplugin (–remove):
    sub­pro­cess installed pre-removal script returned error exit status 2
    postinst called with argu­ment ‘abort-remove’
    dpkg: error while clean­ing up:
    sub­pro­cess installed post-installation script returned error exit status 1
    Errors were encountered while pro­cessing:
    adobe-flashplugin

    So I moved the prerm script out of the way:

    # mv /var/lib/dpkg/info/adobe-flashplugin.prerm /var/lib/dpkg/info/adobe-flashplugin.prerm-DISABLED

    Then the com­mand worked. Thanks!

  12. ixti says:

    @Ali

    All com­mands have to be run with root priv­ileges. This means that either every single com­mand should be pre­fixed with ‘sudo ‘ com­mand or you have to get root priv­ileges per­man­ently with ‘su‘.

    Another thing which can cause this prob­lem is that some­thing is block­ing /var/lib/dpkg/info/adobe-flashplugin.prerm file. For example you have opened this file for edit­ing in mc and for­got to close.

    Any­way I can’t tell for sure. I need more details. So if you’ll con­tact me, I’ll try to fig­ure prob­lem out, so then I’ll update a post with pos­sible prob­lem in mind.

  13. Soulless says:

    Solved the prob­lem. Thanks a lot!

  14. winter says:

    Thanks a lot))))) Joseph’s answer helped to solve prob­lem finally)

  15. Rodrigo says:

    Thanks a lot!!

  16. expmux says:

    good job !
    and long life to wordpress :-)

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>