1

I wanted to repair my system using live USB. In 12.04 Installation, there is no keep my files and repair the system only option (Which was introduced in 12.10).

I went with the normal steps. The system has finished installing and was installing my previous packages. The terminal log was something like this:

Restoring previously installed packages...
Ubuntu ubiquity: warning:root: cannot add XXXXX* (Unable to correct problems, you have held broken packages)  

* This includes: x11, ubuntu fonts, thunderbird, empathy, ...etc.

I ended up with a paralysed install. My mouse didn't move and basically all essential drivers, fonts and anything else important was missing.

How do I correctly repair my system using 12.04 live USB while avoiding the loss of the drivers and such (Including my installed packages as well)?

P.S: I forget I posted the same thing 4 months ago. Both repairs led to the same result.

Zanna
  • 70,465
egy
  • 433
  • 2
  • 5
  • 14

1 Answers1

1

By "keep my files" are you referring to everything in your home folder? If you backed up / copied your home folder somewhere else, then you could do a (fresh) re-install from the live usb, and once it's up & running then create your user again (adduser or useradd) copy your home folder back and be up & running again. Or if your home folder was on a different partition you'd already be half done now.

There are some settings that aren't kept in your home, like /etc/fstab or any custom PPA's or repo's in /etc/apt/sources.list & sources.list.d (but don't just copy those straight over if you move to a different release / version).

I just saw a Q on how to save the list of installed packages/programs, but most methods will list every package including dependencies, libraries, etc. Some methods should list only the main/top packages (since installing them will automatically install their dependencies) and make it easier if you later want to remove a package and it's unneeded dependencies.
apt-mark showmanual sounds like a good one
aptitude search '~i!~M' but it showed everything installed with a fresh install too.

See this answer (and all the answers there) for more info, but these require at least terminal access to your system... maybe chroot from a live usb/cd but I'm not sure about that.

I don't know which drivers you're thinking of, but for a new install you'll probably have to install the drivers again anyway, so do whatever you did last time to install them, hopefully they're in a repo/PPA or easy to find mfg. website (maybe they're updated by now too, or you still have the install files saved?).

I don't know offhand how to fix what's wrong now, but re-installing is a "nuclear option" that should wipe out all the errors...

Xen2050
  • 8,705
  • I did some of what you mentioned while having a system image as a backup. I have some questions: 1- Are all of my installed packages in "home" folder ?
    2- Are there are any settings or essential configs except for what you mentioned ?
    – egy Dec 16 '14 at 18:45
  • The actual packages are installed to places like /bin and others, but you can't really save installed packages by just copying, when they install they run setup scripts that do all sorts of things... BEST way is to re-install them again, easy if they're from a standard (or any) repo / PPA (which should be listed in the sources.list files... The home is mainly config files and your personal files, so when you do reinstall your programs the configuration will be the same (programs "generally" save their configs in your home, but being linux with 10,000 developers there can always be exceptions). – Xen2050 Dec 16 '14 at 19:26
  • I just saw a Q on how to save the list of installed packages/programs, but most methods will list every package including dependencies, libraries, etc. Some methods should list only the main/top packages (since installing them will automatically install their dependencies) and make it easier if you later want to remove a package and it's unneeded dependencies. See this answer http://askubuntu.com/a/181544/129271 (and all the answers there) for more info, but these require at least terminal access to your system... maybe chroot from a live usb/cd but I'm not sure about that – Xen2050 Dec 16 '14 at 19:34
  • And, there probably are some sort-of essential info not stored in your home, I remember a network manager used to save wifi passwords somewhere in /etc so I'd keep the backup copy for a while. Whether you'll really need any of the other settings, I guess it depends on how much manual configuring was done after installing. When Installing packages they can do a lot on their own (they can run a preinst and postinst script and possibly others) – Xen2050 Dec 16 '14 at 19:41
  • Thank you Xen for your comments. Currently, I have access to terminal but apt-get is damaged. I can't neither install nor uninstall anything (or even show the existing list of packages). I will have to manually get around re-installing my packages. I will try using dpkg for now and I will inform you later. Sorry for the late reply. – egy Dec 22 '14 at 11:28
  • You're welcome, sorry I don't have a "great" solution. You could try googling whatever new errors come up... This might be helpful with apt http://askubuntu.com/questions/223237/unable-to-correct-problems-you-have-held-broken-packages If you've already got a backup of everything and can't get the current install going, a fresh install might be the quickest, then restore home & install whatever's needed? – Xen2050 Dec 22 '14 at 22:29