Today I’ve made one mistake. I’ve installed on my Debian squeeze/sid a package 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 trying 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 solution on russian forums: Lafox.NET and LinuxForum.RU. So for those of you who are not familiar with russian language I’m proud to explain the solution.
The problem is that this package was built ONLY for Ubuntu. And before removing itself it tries to execute pre-remove action on every package listed in VARIANTS variable of /var/lib/dpkg/info/adobe-flashplugin.prerm. So all we need to do is to comment out that variable. So after you will comment 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 mentioned in comments, sometimes this solution does not help. So in fact the easiest way to “force” removal of plugin is to “disable” APT’s pre-rm requisitions by simple renaming it:
# mv /var/lib/dpkg/info/adobe-flashplugin.prerm /var/lib/dpkg/info/adobe-flashplugin.prerm-DISABLED
But don’t forget to remove adobe-flashplugin.prerm-DISABLED manually once package was removed.
Thanks so much. This was a better solution than all 5 top posts on google. Your fix was the quickest, and easiest.
Thanks again..
thanks a lot !!!
Thank you very much. This was easy and fast help.
Yeah! You rule!
+1 Yes! Thank you very much.
Cool, this fixed the corrupted dpkg database status issue for me. Thanks!
dpkg –force-all –remove adobe-flashplugin
dpkg: operation requires read/write access to dpkg status area
That what i get When i put in your last command in terminal Please HELP!!!
@adam:
Seems like your dpkg status area is locked by another process (e.g. apt-get or aptitude installing/updating/removing) or you don’t have rights. You have to run it with root privileges. If you still having problems, you can contact me via xmpp:zapparov@jabber.ru or via irc:ixti@freenode.net
How to run with root privileges? have same problem as Adam…
thanks
Wonderful!
Really Really Thank You!
Thanks for the post. On my Debian testing install, I wasn’t able to fix this problem immediately:
# 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 … 142017 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
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 command worked. Thanks!
@Ali
All commands have to be run with root privileges. This means that either every single command should be prefixed with ‘sudo ‘ command or you have to get root privileges permanently with ‘su‘.
Another thing which can cause this problem is that something is blocking /var/lib/dpkg/info/adobe-flashplugin.prerm file. For example you have opened this file for editing in mc and forgot to close.
Anyway I can’t tell for sure. I need more details. So if you’ll contact me, I’ll try to figure problem out, so then I’ll update a post with possible problem in mind.
Solved the problem. Thanks a lot!
Thanks a lot))))) Joseph’s answer helped to solve problem finally)
Thanks a lot!!
good job !
and long life to wordpress :-)