grizzler wrote:...a package built to (Debian/Ubuntu) standards should never touch anything
in the user's home directory during installation. The application installed with the package may create user specific settings there once it's started, but if it finds any that were created previously, it should simply use those.
That's the theory. Does every package/application behave itself in that respect? I have no idea...
So far so good, grizzler!
Following the general outline of Cosmo's recommended tutorial, I rearranged the partitions to put /home on one of its own, then reinstalled the system again. I'd always arranged things that way before, but decided when I installed this system to accept the defaults. I then moved a backup copy of my /home/user data into the new /home/user directory.
Finally, I booted into the new install. I cannot tell you how much of a relief it was to see my familiar desktop configuration re-appear, finally!
I only have the one user, me, so I didn't need to restore any other user files. I confirmed the software sources were updated. I then demonstrated that just copying the contents of /etc/apt won't work to restore your PPA's, and then did as directed to re-install them from their sources on the internet.
Then I used the Update Manager to bring everything up to current versions.
What was next was to reinstall all the rest of my packages. Without a backup of the old package list, I had to spend a good while synthesizing one from the data I had available. I had one list of the packages still installed after the disaster that were not part of the original installation of the system, that I'd generated from some clever command-line tricks I found in posts on an online help forum. Then I had the list of packages that had just been uninstalled by the fatal aptitude command, courtesy of the dpkg log -- which required cleaning up with some basic sed commands.
Once I had both lists reformatted cleanly, I manually culled out anything that was obviously a dependency of some other package; libraries, for instance. I went through both lists one at a time, putting the package name in the filter field of Synaptic and eliminating that item from the list if it was part of another package to be installed or already installed on the system. I finally concatenated the two lists, sorted them together and removed duplicates, and had my final master list of about 120 packages.
After a bunch of head-scratching and delving into the depths of arcane linux commands, I arrived at a relatively simple way to batch install the packages. I edited the list to replace newlines with spaces using the search/replace function of the text editor, then added the command I wanted to execute before the list of packages... As a preliminary test, I made a new file something like this:
Code: Select all
apt-get -s install package1 package2
... with a couple of small packages I knew were on the list. I chmod +x'd the file, then ran it first as user, then using sudo, and the simulations appeared to run just fine.
I then swapped in the full list and ran the simulations again. A couple of packages were not found, a couple more were already installed, so I eliminated them from the script. It didn't take long to get a clean run without error messages. It would be installing over 300 packages and dependencies... an amazingly similar number to that which had been removed!
Taking a big breath, I removed the -s from the script and re-ran it with sudo. It took a long while, but I sat watching it and saw nothing amiss but a couple of warning messages that seemed harmless. It didn't fill up memory or disk space, or otherwise choke or explode.
Lo and behold! Everything I've tried so far appears to be back and functioning. I had to reinstall Google Earth, tweak Firefox to get Flash working again properly, and a couple other minor quirks, but nothing I'd object to after all I've been through.
All I've got to say is, WOW! And thanks for the help, folks...
Cosmo. wrote:Important: If you copy partitions with GParted and place them on a internal hard drive you must change the UUID of those copies. Otherwise Linux gets confused, that there are 2 partitions with the same UUID and fails to boot. Changing the UUID can be easily done with GParted, look at the context menu of the copied partitions.
THANKS for pointing out this detail, Cosmo! I'm sure it would have tripped me up and wasted a bunch more time. Indeed the two copies had the same UUID. The dialog box that you can bring up from the context menu gives you the choice to generate a new random UUID. Problem solved!
Regarding restoring the software selection: Of course there must have been created a backup as described in the tutorial in step 2.a.
Which wasn't possible AFTER the disaster, when among everything else, the Mint Backup tool wasn't there and the packages I would have wanted a list of had just been uninstalled anyway. OOPS!
The way to protect against that: Make regular backups. I make a daily backup of all hidden files and folders (excluding parts of them as the Trash or the cache) automatically with Back in Time and I do not even notice, that this happens, because this goes so fast.
And this experience has certainly driven home the importance of doing just that. Even if I'd just backed things up regularly on another partition of the HD I'd have been able to restore the system to its previous state with minimal grief.
So, I've still got to reinstall my Brother printer drivers and check a few more things, but all in all, I believe I'm just about back to where I was. Next, actually impliment a backup strategy!
Thank you, again.
Mike