10

Because I played around too much with the proposed repository (on 14.04), I want to go back to step 1: remove every package on the system except those I've manually installed and reinstall the base system, without going through the hassle of reinstalling.

Basically, is there anyway to safely and remotely over ssh:

  • remove all packages except manually installed ones
  • reinstall everything from the kernel to ubuntu-desktop (preferably automagically without any further packages getting marked as manually installed)
  • install dependencies of the manually installed packages

N.B. I've intentionally left out in hopes of getting answers unspecific to any particular version(s).


It seems I haven't described what I want simply enough, I think these two points would take care of the above:

  • purge all auto-installed packages (@kos answered that on @Fabby's answer)
  • install the packages that makes up a fresh Ubuntu install

And I'm guessing if the dependencies of manually installed packages do get uninstalled, apt-get -f will help me with them.

Oxwivi
  • 17,849
  • are all the files you need to save in /home? 2. is the network stable? If you were to move your userfiles or whatever you need to save, could you over write everything, and move user-files back easily? Also. is PXE enabled? and are there Virtualization support tools in the BIOS?
  • – j0h Oct 29 '15 at 04:03
  • @j0h 1. Nothing important in /home, but there are important configuration in manually installed packages, 2. Yes, but as I said user files are not the worry, 3. Yes, it's enabled, 4. And yes, there's virtualization support as well. – Oxwivi Oct 30 '15 at 02:35
  • This is a bit over my level of expertise, but wouldn't it be easier to get a packages list from a fresh install, diff it against your current install to get a list of everything added. Then do a fresh install and automagically add back in all the custom stuff - possibly with a restore of some or all of the config files in $HOME? You get the lists by running dpkg -l. This will probably mark a lot of the additional stuff as manually installed - rather than as dependencies which could go away if the package that needed them is deleted later. – Joe Oct 30 '15 at 08:02