manually fixing a file

Asked by Denise on 2009-12-22

I'm having a heck of a time fixing the flash plugin nonfree package. It's telling me that I need to manually fix it, but I don't know what to do. Please help, thanks!

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Solved by:
Tiago Faria
Solved:
2009-12-24
Last query:
2009-12-24
Last reply:
2009-12-23
Federico Vera (fedevera) said : #1

Try the following, open a terminal (Applications->Accesories->terminal) and paste the following:

sudo apt-get install flashplugin-installer flashplugin-nonfree

You can also automatize the installation of some troublesome applications with Ailurus https://edge.launchpad.net/ailurus

Denise (britdees) said : #2

thank you, but this is what I'm getting after implementing your suggestion:

denise@denise-desktop:~$ sudo apt-get install flashplugin-installer flashplugin-nonfree
[sudo] password for denise:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.31-14 linux-headers-2.6.31-14-generic
Use 'apt-get autoremove' to remove them.
Suggested packages:
  xulrunner-1.9 konqueror-nsplugins msttcorefonts ttf-bitstream-vera
  ttf-dejavu ttf-xfree86-nonfree xfs
The following NEW packages will be installed:
  flashplugin-installer
The following packages will be upgraded:
  flashplugin-nonfree
1 upgraded, 1 newly installed, 0 to remove and 14 not upgraded.
1 not fully installed or removed.
E: Could not get lock /var/cache/apt/archives/lock - open (11: Resource temporarily unavailable)
E: Unable to lock the download directory
denise@denise-desktop:~$

Federico Vera (fedevera) said : #3

Hi again, that last lines you posted suggest that other package manager is running, perhaps you are updating your system, installing applications or have synaptic opened.
Make sure that none of those things are going on (if none is running you could try restarting your computer), and then copy the following in the terminal (everything after a # is a comment don't copy them):

# This should remove the current installation
sudo apt-get remove flashplugin-installer flashplugin-nonfree

# This should update your package list
sudo apt-get update

# This should repair any package installation
sudo apt-get -f install

# Now this should install flash
sudo apt-get install flashplugin-installer flashplugin-nonfree

sudo apt-get --purge autoremove

If you are running 64bit I can give a command to get you native 64bit flash rather than the flashplugin-nonfree which uses the 32bit + nspluginwrapper

Denise (britdees) said : #5

Ok, thanks again, this is what I'm getting now:

denise@denise-desktop:~$ sudo apt-get remove flashplugin-installer flashplugin nonfree
[sudo] password for denise:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package flashplugin-installer is not installed, so not removed
Package flashplugin is not installed, so not removed
E: Couldn't find package nonfree
denise@denise-desktop:~$ sudo apt-get install flashplugin-installer flashplugin-nonfree
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.31-14 linux-headers-2.6.31-14-generic
Use 'apt-get autoremove' to remove them.
Suggested packages:
  xulrunner-1.9 konqueror-nsplugins msttcorefonts ttf-bitstream-vera
  ttf-dejavu ttf-xfree86-nonfree xfs
The following NEW packages will be installed:
  flashplugin-installer
The following packages will be upgraded:
  flashplugin-nonfree
1 upgraded, 1 newly installed, 0 to remove and 14 not upgraded.
1 not fully installed or removed.
Need to get 0B/21.4kB of archives.
After this operation, 61.4kB of additional disk space will be used.
Preconfiguring packages ...
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)
denise@denise-desktop:~$ sudo apt-get remove flashplugin-installer flashplugin-nonfree
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package flashplugin-installer is not installed, so not removed
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.31-14 linux-headers-2.6.31-14-generic
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
  flashplugin-nonfree
0 upgraded, 0 newly installed, 1 to remove and 14 not upgraded.
1 not fully installed or removed.
After this operation, 168kB disk space will be freed.
Do you want to continue [Y/n]? Y
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)
denise@denise-desktop:~$ sudo apt-get update
Hit http://security.ubuntu.com karmic-security Release.gpg
Ign http://security.ubuntu.com karmic-security/main Translation-en_US
Hit http://archive.canonical.com karmic Release.gpg
Ign http://archive.canonical.com karmic/partner Translation-en_US
Hit http://us.archive.ubuntu.com karmic Release.gpg
Ign http://us.archive.ubuntu.com karmic/main Translation-en_US
Ign http://security.ubuntu.com karmic-security/restricted Translation-en_US
Ign http://security.ubuntu.com karmic-security/universe Translation-en_US
Ign http://security.ubuntu.com karmic-security/multiverse Translation-en_US
Hit http://security.ubuntu.com karmic-security Release
Hit http://archive.canonical.com karmic Release
Ign http://us.archive.ubuntu.com karmic/restricted Translation-en_US
Ign http://us.archive.ubuntu.com karmic/universe Translation-en_US
Ign http://us.archive.ubuntu.com karmic/multiverse Translation-en_US
Hit http://us.archive.ubuntu.com karmic-updates Release.gpg
Ign http://us.archive.ubuntu.com karmic-updates/main Translation-en_US
Ign http://us.archive.ubuntu.com karmic-updates/restricted Translation-en_US
Ign http://us.archive.ubuntu.com karmic-updates/universe Translation-en_US
Ign http://us.archive.ubuntu.com karmic-updates/multiverse Translation-en_US
Hit http://us.archive.ubuntu.com karmic Release
Hit http://security.ubuntu.com karmic-security/main Packages
Hit http://us.archive.ubuntu.com karmic-updates Release
Hit http://archive.canonical.com karmic/partner Packages
Hit http://security.ubuntu.com karmic-security/restricted Packages
Hit http://security.ubuntu.com karmic-security/main Sources
Hit http://security.ubuntu.com karmic-security/restricted Sources
Hit http://us.archive.ubuntu.com karmic/main Packages
Hit http://us.archive.ubuntu.com karmic/restricted Packages
Hit http://us.archive.ubuntu.com karmic/main Sources
Hit http://us.archive.ubuntu.com karmic/restricted Sources
Hit http://security.ubuntu.com karmic-security/universe Packages
Hit http://security.ubuntu.com karmic-security/universe Sources
Hit http://security.ubuntu.com karmic-security/multiverse Packages
Hit http://security.ubuntu.com karmic-security/multiverse Sources
Hit http://us.archive.ubuntu.com karmic/universe Packages
Hit http://us.archive.ubuntu.com karmic/universe Sources
Hit http://us.archive.ubuntu.com karmic/multiverse Packages
Hit http://us.archive.ubuntu.com karmic/multiverse Sources
Hit http://us.archive.ubuntu.com karmic-updates/main Packages
Hit http://us.archive.ubuntu.com karmic-updates/restricted Packages
Hit http://us.archive.ubuntu.com karmic-updates/main Sources
Hit http://us.archive.ubuntu.com karmic-updates/restricted Sources
Hit http://us.archive.ubuntu.com karmic-updates/universe Packages
Hit http://us.archive.ubuntu.com karmic-updates/universe Sources
Hit http://us.archive.ubuntu.com karmic-updates/multiverse Packages
Hit http://us.archive.ubuntu.com karmic-updates/multiverse Sources
Reading package lists... Done
denise@denise-desktop:~$ sudo apt-get -finstall
E: Command line option 'i' [from -finstall] is not known.
denise@denise-desktop:~$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-2.6.31-14 linux-headers-2.6.31-14-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  flashplugin-installer flashplugin-nonfree
Suggested packages:
  xulrunner-1.9 konqueror-nsplugins msttcorefonts ttf-bitstream-vera
  ttf-dejavu ttf-xfree86-nonfree xfs
The following NEW packages will be installed:
  flashplugin-installer
The following packages will be upgraded:
  flashplugin-nonfree
1 upgraded, 1 newly installed, 0 to remove and 14 not upgraded.
1 not fully installed or removed.
Need to get 0B/21.4kB of archives.
After this operation, 61.4kB of additional disk space will be used.
Do you want to continue [Y/n]? Y
Preconfiguring packages ...
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)
denise@denise-desktop:~$

sudo apt-get --purge autoremove; cd /var/cache/apt/archives; sudo apt-get --force-all -i ./*.deb; sudo apt-get clean

Federico Vera (fedevera) said : #7

Hi again... lets try this:

# this should force the removal of the current flashplugin (it cannot fail...)
sudo dpkg --remove --force-remove-reinstreq flashplugin-nonfree

sudo apt-get install flashplugin-installer flashplugin-nonfree

hope it helps!

Denise (britdees) said : #8

thanks action, I have a 32 bit. Here's what I got after your suggestion.

denise@denise-desktop:~$ sudo apt-get --purge autoremove; cd /var/cache/apt/archives; sudo apt-
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run `apt-get -f install' to correct these.
The following packages have unmet dependencies:
E: Unmet dependencies. Try using -f.
sudo: apt-: command not found
denise@denise-desktop:/var/cache/apt/archives$ get --force-all -i ./*.deb; sudo apt-get clean
No command 'get' found, but there are 17 similar ones
get: command not found
denise@denise-desktop:/var/cache/apt/archives$

Try copying the WHOLE command as one, rather than chopping it up and screwing up the command. Try Frederico Vera's advice then try:

cd /var/cache/apt/archives; sudo apt-get --force-all -i ./*.deb; sudo apt-get clean

Denise (britdees) said : #10

I'm sorry to be such a pain in the butt.. lol And I really appreciate you both for trying to help me. I tried Frederico's first and got this:

denise@denise-desktop:/var/cache/apt/archives$ sudo dpkg --remove --force-remove-reinstreq flashplugin-nonfree
[sudo] password for denise:
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 ... 138616 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
denise@denise-desktop:/var/cache/apt/archives$

I have tried reinstalling it but it doesn't seem to let me do that either.

Federico Vera (fedevera) said : #11

wow, that's a strange problem, and unfortunately that was my last resort, sorry I couldn't help, hope some with a little more experience is able to help you

Denise (britdees) said : #12

thank you anyhow.. I'm thinking I should just reinstall unbuntu.. and start fresh.

Best Tiago Faria (gouki) said : #13

According to the bug report I just linked this question to, people report success with the answers that were already given:

- rm /var/lib/dpkg/info/flashplugin-nonfree.prerm
- dpkg --remove --force-remove-reinstreq flashplugin-nonfree
- dpkg --purge --force-remove-reinstreq flashplugin-nonfree

Also, you may want to try and install adobe-flashplugin if this fix doesn't work for you.

+1 on a fresh install though :)

No need. This will fix it:
http://www.khattam.info/2009/08/04/solved-subprocess-pre-removal-script-returned-error-exit-status-2-error/

Basically you are going to do some low level editting to make the system think the package isnt even installed. Its a bit hacky but is sometimes needed in package systems when the packages get muddled. This is one of the biggest weaknesses in package based systems.

Denise (britdees) said : #15

Thank you to all that answered. I just went ahead and reinstalled ubuntu. Hope you all have a very merry Christmas!