Friday, May 10, 2024
 Popular · Latest · Hot · Upcoming
3
rated 0 times [  3] [ 0]  / answers: 1 / hits: 1883  / 2 Years ago, mon, november 14, 2022, 1:53:42

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.



EDIT:



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.


More From » 12.04

 Answers
6

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.


[#35594] Tuesday, November 15, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
scusaper

Total Points: 335
Total Questions: 111
Total Answers: 119

Location: Belize
Member since Mon, Jun 20, 2022
2 Years ago
scusaper questions
Fri, Apr 15, 22, 15:26, 2 Years ago
Wed, Mar 15, 23, 03:53, 1 Year ago
Sat, Jun 4, 22, 18:03, 2 Years ago
;