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 =)
Pingback: Tweets that mention Shadows of epiphany » Blog Archive » apt-get how to fix very broken packages -- Topsy.com
Before I began the upgrade from 8.04.3 to 10.04 I made sure I had backups of my important company files. My 8.04.3 Server went to 10.04 Server as slick as glass. Karmic remix to Lucid remix on my notebook went normally with no issues. The netbook will take some getting used to.
I had the same bad experience with 8.04.3 Desktop laptop as you did and fussed around quite a bit with some similar fixes that didn’t remove the offending flashplugin-nonfree. I noticed that updates were broken also. However, since I had Karmic on a USB stick, I formatted the drive with Hardy to ext4 and was good to go with a Karmic install from the stick. Then I upgraded to Lucid and things are working properly again. Lots of hours lost, but at least it was over Saturday and Sunday.
Now I’ve got hours more “fun” getting ssh working with rsync between my computer, the netbook and my server. Oh joy, but at least my files, Bash & Python scripts, e-mail, Wine-required programs are restored and are now back to working as I need them to be.
In retrospect, perhaps I should have waited a few days from the release of Lucid.
It worked! after all finally back to normal.
Thank you.
Pingback: Bodhi.Zazen: apt-get how to fix very broken packages | TuxWire
I had to do the exact same thing after attempting to install the R statistics package (r-recommended) in Ubuntu 10.04, which gave me tcl8.5 that could be neither removed nor fully installed. I had to sudo rm /var/lib/dpkg/info/tcl8.5*, after which R successfully installed.
I have not had to get dirty with installation like this before.
Pingback: Links 3/5/2010: Lubuntu 10.04 Released; Peppermint OS Reviewed | Techrights
Pingback: fix broken apt-get packages | Linux Shtuff
@Dave Mawdsley – Aye. When updating ANY OS I advise backups and the readiness to perform a fresh install. On “production” servers I prefer to try upgrades on similar hardware (if possible) or an image in KVM / VirtualBox / VMWare first as a “dry run”. Once I work out all the “bugs” , then upgrade the production server.
Thanks for the tips. I suppose the only downside is I might have some dangling, unregistered binaries.
@Nate – search for them (find or locate) and manually delete them if you wish.
Search under the name of the package you had to manually remove.
Found your post on the planet a while ago and managed finally to apply it in my Hardy>Lucid machine.
apt-get was indeed fixed!
Thank you very much :)
@Rubén Romero – You are most welcome, glad it worked.
Found just what i needed.Thank you very much.
That worked. Thank you very much.
Thanks! I was stuck trying to remove a broken install of postgresql-7.4 and these steps finally fixed it for me.
Great!
I tried to upgrade libgtk2.0-0 to install the last flashplugin (the one I have does not work in fullscreen)
and then everything went wrong, synaptics was not working anymore and apt-get -f was trying to remove like 3 gb of packages.
your trick did the job perfectly!
Thanks!
After a full day of terrible, broken, regret and finally success, I could hug you. I don’t know how to be more clear than that.
Thank you
THANK YOU!!
You fixed my system!
Wow, I’ve had all kinds of trouble after running Update Manager on my Ubuntu 10.10. In my case it was python-egenix-mxtools. I couldn’t do any updates or installs. It was rather frustrating and I couldn’t find any solutions, until now that I ran across this little article. Like the others have said, THANK YOU!!
Benjamin B. – Glad it worked =)
it worked for me. update manager crashed while installing crossplatfomui.
thank you,
@chandu_ycm
Glad the information helped.
My system was damage during the upgrading from Ubuntu 9.04 to 10.04 by energy fail. When it come back, the git-core package was broken and nothing I’ve done can solve it, until I found this post.
You save my day!
Thank you!
Thank you! With those instructions I finally managed to get rid of errors with half-installed Samba on my Nokia N900 :)
Thank you so much for this how-to! I was having issues with bandwidthd on 11.04, which was incompatible with Natty in the first place.
This was a quick and easy fix to a frustrating problem.
Thank you!
Saved me from re-installing the system!
Thanks for this, it saved my life!
I have tried apt-get update –fix-missing. I have tried deleting the list files, I have tried fixing the broken source, I remove lonelycoder, but I am still unable to get past the below message. Any help would be very much appreciated!!!!! I’m ready to re-install, but have so much invested, I hate to start all over. Especially since Apple has quit signing my firmware. I do have ssh blobs saved :)
Family-Room-Apple-TV:/var/lib root# apt-get update
Get:1 http://www.lonelycoder.com hts Release.gpg [198B]
Hit http://www.lonelycoder.com hts Release
Err http://www.lonelycoder.com hts Release
Get:2 http://www.lonelycoder.com hts Release [1782B]
Ign http://www.lonelycoder.com hts Release
Ign http://www.lonelycoder.com hts/main Packages
Ign http://www.lonelycoder.com hts/main Packages
Err http://www.lonelycoder.com hts/main Packages
HTTP/1.1 404 Not Found
Fetched 1980B in 4s (453B/s)
W: GPG error: http://www.lonelycoder.com hts Release: The following signatures couldn’t be verified because the public key is not available: NO_PUBKEY 944EFDEB195D7AA2
W: Failed to fetch http://www.lonelycoder.com/debian/dists/hts/main/binary-iphoneos-arm/Packages.gz HTTP/1.1 404 Not Found
E: Some index files failed to download, they have been ignored, or old ones used instead.
@Karma : You are having a problem with a third party repository .
You will need to contact the project directly and determine what changes the maintainer made to the repositories, looks as if they moved to git.
Otherwise , edit your sources and remove or comment out those repositories.
https://help.ubuntu.com/community/Repositories/Ubuntu
Pingback: [Debian] Updating - issues
Thank you! I had the same problem with pidgin-ppa on Debian. The package was broken, and then I couldn’t remove it by the traditional means and it broke apt completely. Now my apt is working again, thanks to you!
@Gabi – you are most welcome.
Thanks,
Able to remove package and reinstall properly .
Much appreciated!
Pingback: Udate and dependency
Der Hinweis hat mir gerade eben sehr geholfen.
Danke! You made my day… :)