Updater (I assume) put a no entry style alert icon on the panel which informed me that certain package dependencies were not up to snuff. Upgrades were thereafter only partial. The dialogue advised that I sudo apt-get install -f. I did this hoping that app-get would fulfil dependencies and replace corrupted files and watched it systematically remove every component of linux, both the stuff I had installed and the core ubuntu packages. I could only assume at this stage that this was in preparation for a fresh install but, of course, I know better now - if you find yourself with apt-get warning you that you are about to remove several hundred packages and asking you to type an involved confirmation string seek advice before proceeding. I digress. This was a 64 bit install of 12.04. All that is left is grub pointing to a couple of windows recovery partitions on the hard drive. Thankfully the Ext4 partition is reachable from a stick boot.


I've logged onto the machine with a 64 bit stick and can see the file structure left behind by apt-get after {ahem} fixing. My first instinct was to run install from the stick but it seemed to want to do another install rather than a repair. My question then: is there a way to recover the current installation so that if I reinstall the packages I had they will pick up the original settings? I'm particularly worried about losing email from evolution - the rest I could probably lash back together.

As for the use of PPA I'm not sure what you're driving at. I generally use Ubuntu Software Centre to install software, though I have used terminal scripts to add new repositories and software successfully following guidance on various websites. The most recent change I made was a downgrade of Wine in an attempt to install and run excel2007 (a necessity, I think, as I have VBA work to do). The installer had stalled and had to be killed. I wonder if that corrupted whatever database holds a model of the package installation structure.

I would also be interested to know how this disaster came about. I see people in the know recommending the sudo apt-get install -f as a fairly innocuous cure in similar circumstances.

Thanks for your attention,

Tony Martin

p.s. Do please forgive the rant aspects of the original post. It's hard to write rationally with a large hole in the pit of your stomach.

  • 7
    please rephrase this into a question that can be answered. At the moment it reads as a tale of woes and as such could be construed as "not constructive" and therefore may be subject to closure. Thanks – fossfreedom Sep 12 '12 at 19:08
  • 1
    This may be a bug with apt. Please tell us if whether you are using PPA's bu editing your question. It would also help get publicity to your question if you rephrased it into a question outlining what you want done, such as recovering files or something else. Currently, we see a set of problems, but no statement as to what you would like help to accomplish. – nanofarad Sep 12 '12 at 19:29
  • Since you have greatly improved the question, I have answered it and given an upvote for your effort. Thanks! – nanofarad Sep 12 '12 at 22:43

This disaster tends to come about when a broken package (typically one with dependencies that cannot be installed due to their not existing or the user having set up a hold on a specific package version) is present or when the user has installed conflicting dependencies from a PPA. The -f flag tells apt-get to find any solution it can to remove all breakage from the system. In this case the 'solution' was to remove almost every package, so you must have had a really low level conflict somewhere. It looks at what dependency appears to not be installable and either installs or removes packages until it can install that dependency or until all packages that conflict are gone. I once had every piece of GUI software right down to X removed because of an improperly packaged version of Libreoffice.

You can see from this image that a bad wine package from a PPA could indeed kill the whole system: Pretty half the system depends on libc6. If libc6 were to be replaced via a PPA with another version that would indeed cause APT to remove the whole system. Just about everything winds up depending on libc6 in the end, including the kernel I think. I'm not saying for sure this was it, just using this as an example to show how dependencies are interconnected.

You can use the LiveUSB to copy your files over before reinstalling or just reinstall with the advanced partitioning settings. I recommend just using the advanced settings to reinstall because it saves you copying any files off the disk, so long as you've not stored anything outside of /home and /srv.

You need to make sure that your ext4 filesystem is set to mount to '/' and that the box under 'Format' is not checked like it is in this image:

enter image description here

Anything not stored in /srv or /home will be DELETED.

If you wish to use the same username you should move or rename your home folder before reinstalling so it can be recreated with fresh configs from /etc/skel. You can then copy configuration files and data from where you moved it to their proper places after the reinstall. This is necessary as some programs (Firefox for example) will not pick up the config files from your old install automatically even if they're already in the home folder the first time you log in. Some programs need to be run first, quit, and then have their configuration files copied over.

I'm pretty sure for evolution you can just copy the .evolution file from your old home to the new one and have it work normally. You may need to run evolution once and close it before copying over like I mentioned above.

As per your comment on how to properly solve this issue, the manual for apt-get (the section about -f) suggests using dpkg --remove $PACKAGE to remove the package causing the problem manually. This should allow apt to run again as the package trying to pull in non-existent or un-installable dependency will be gone.

The problem that killed your machine is a fluke, it simply should not ever happen on a stable release of Ubuntu. The repository system is organized to prevent this from happening, but the addition of random PPA X throws a wrench into what is otherwise a perfect system. I suggest you examine closely the contents of your added PPAs and which software packages are installed (and upgraded to) from them. Several PPAs will upgrade important system packages in order to make the software they contain work. This is great until the newer dependency from the PPA conflicts with the older one in the repo. At this point APT will always install the newest one, and boom, your system will not upgrade any packages because the Ubuntu repo software is still in need of the older library version, which is not going to be installed.

The best of luck to you. Please comment if you have questions or if I can improve this answer.

  • Thank you to both ObsessiveFoss and Mark for very comprehensive answers. I shall try the parallel installation at the earliest opportunity. I believe .evolution settings are now in ~/.local but should be safe at home as Mark suggests. I'd had a previous failure with Office2007 on PlayOnLinux but I shall certainly try again following ObsessiveFoss's experience. Incidentally, for the benefit of anybody in a similar position as I, wondering whether to proceed, how might I have repaired this problem without such disastrous results? – Tony Martin Sep 13 '12 at 6:30
  • Just to conclude with regard to the recovery - all went as Mark suggested except I had to settle for another user name, being unable to rename the old user home from a stick login - small matter. I have my old emails and all other data safely in my new home directory and the rest of the recovery is simply chore. Thanks again chaps for turning what seemed to be a major crisis last night into a bit of a faff this morning. p.s. I, and I'm sure others, would love to know the correct way out of this issue, should it arise again. – Tony Martin Sep 13 '12 at 8:15
  • Hi Tony, I edited the answer with some more info, including a possible fix I found in the manual for apt-get. – Mark Paskal Sep 15 '12 at 0:53
  • Thanks Mark, your illustration clarifies the situation immensely. Perhaps a safer path to using alternative PPAs is to run an update check immediately to see if issues have arisen so that one can more readily identify an offensive package and remove it before it becomes an issue. All early belly-aching aside, Linux has come on immensely since me flirtation with Red-Hat 5 and I've been so impressed with it that I've put it on my media player and two laptops as sole OS. Thanks for helping to make this disaster significantly less troublesome than an Windows reinstall would have been. – Tony Martin Sep 15 '12 at 8:06

The addition of repos and wine downgrades may have caused issues. Perhaps once you reinstall, you could use Playonlinux to tun Word? It includes auto-setup and selects the right Wine version and settings automatically. It doesn't muck with APT too much, so it is safer. While it involves using a repository, this one works well and will not cause issues as long as the correct version of Ubuntu is selected. As for getting your settings back, you can mount your partition from the live CD and then in your home folder, press Ctrl+H and copy the .evolution folder to a flash drive. You can also copy other folders you may want, and then restore them on your new installation.

I have tested PlayOnLinux with Office '07 and it works very well. It uses Wine as executables, and does not use APT to get Wine versions.

  • For some odd reason Playonlinux would not read my media. I ran the setup.exe and was able to install Excel so that it would work so I'm delighted with that. Couldn't get Publisher to work, but I only wanted to convert my files as I'm determined to move over to Linux tools. OneNote also not working but others have managed with .dll shenanigans. I've not tried the rest of Office as I'm determined to wean myself away. Thanks again for your help. – Tony Martin Sep 15 '12 at 8:04

Backing up evolution should be done due to the option in the data menu - backup evolution. just copying .evolution is not a very safe possibility to restore old configuration.

  • Alas, on this occasion that horse had already left the stable. Certainly I shall backup in future and my next adventure in learning Linux will be to find a backup procedure that will allow painless recovery from disasters such as the one I encountered. Thanks for the pointer. – Tony Martin Sep 15 '12 at 8:06

I was able to fix my corrupted apt thanks to http://ubuntuforums.org/showthread.php?t=1904226&p=11586018#post11586018.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.