14

I started with Ubuntu around 3 years ago and have been a dedicated user ever since. During that time I tried out lots of apps, themes, etc. And, I've updated every version as it has come along so now I'm running Lucid.

Basically, my system has gotten sort of "messy" and I'm planning a vigorous clean up and a fresh install. My /home is on a separate partition from everything else, so I can preserve that. I want to find and remove unused, unneeded apps (which I pretty much understand how to do). Also, I want to get back to the default desktop theme and build back up from there. And other messes surely exist.

So, my question is, What is a good, logical plan to clean up and freshly reinstall my system? (One note is that I have found many links in searches on this issue. There are many links on this topic and many are out of date. So, it's gotten rather confusing to say the least.)

Thanks.

6 Answers 6

11

There are 4 things you generally want to preserve when you do a re-install.

  1. Your home directory - as mentioned, you have home on a separate partition.
  2. Any customisations you've made in /etc. If you've made any, you probably did them by hand and therefore have some idea of what they are.
  3. Your list of installed programs. Executing dpkg --get-selections | grep install > installed.txt will create a list of packages that are currently installed. In your case this doesn't sound like something you want to preserve, so you could skip this step.
  4. Your /var directory. Some programs store important data here, so it's worth backing up. Things I've seen stored in /var include mail directories, databases, game save files, and web configuration files. Having a backup means you can selectively restore anything that turns out to be needed.

So, a plan would probably look something like this:

  1. Back up any customisations in /etc.
  2. Back up your /var directory.
  3. Either run dpkg --get-selections | grep install > installed.txt or run an eye over the Applications menu for the names of any applications you use regularly.
  4. Re-install your system.
  5. Install any missing applications. If you want to use the generated list, you can do:

    sudo dpkg --set-selection < installed.txt
    sudo apt-get install --yes dselect
    
  6. Re-apply your customisations in /etc (if still needed).

  7. Upgrade your home partition to ext4 (optional, see the Ubuntu wiki for details).
  8. Restore anything that turns out to be needed from /var.

I would recommend against wiping out the configuration files in your home directory; you'll lose things like your browser bookmarks and security keys, for example. A better strategy for getting back to default settings would be to create a new user account and compare their settings to the ones your normal account is using.

2
  • Where does the installed.txt go?
    – Will
    Aug 7, 2010 at 19:46
  • In whatever directory you're in when you run the command; usually that will be your home directory.
    – jbowtie
    Aug 8, 2010 at 21:32
4

This all depends on personal preferences. But if this was my system, I would do a clean install - including reformatting /home.

The reason I would do this is because the 7.xx series used the ext3 filesystem, while the new 10.04 uses ext4. You can convert from ext3 to ext4, but it is much easier to reformat since I would be reinstalling anyways.

You will have to back up /home to a separate drive. I would backup just the files I need, and leave out the config files (hidden files like .gnome2, .gconf, etc.). After I reinstall, just copy the files back into place.

This may or may not be the best way to do. It depends on your preferences and objectives.

3

When I want to start over Ubuntu I usually follow this steps:

  • Boot from LiveCD.
  • Mount my home partition
  • Rename my home dir to something like javier-old.
  • Install, keeping my home partition, the install will create a new home for the default user (javier in this example)
  • After installing I move all my normal files from javier-old to javier.
  • Then I locate the config files from the programs that I want to keep settings and move then from javier-old to the new home (usually .thunderbird, .gnome2/gedit, .ssh, .Private, etc...)
  • Firefox gets special treatment. I left over the extensions folder and just copy the other files. Sometimes a do a more granularly copy of firefox files. Usually I just want the bookmarks and the passwords.

And that is all. That way not only I start with a clean system, I reset most apps to their default, but the ones that I really want.

Finally I keep the javier-old dir there just in case I want to recover some data or some configuration later.

4
  • This looks like a pain free way to go. Odd-rationale above mentioned the issue between the ext3 and ext4 filesyestems. Will I be able to do this? Or is it a big concern?
    – wdypdx22
    Aug 6, 2010 at 16:52
  • Doh! I actually just noticed this from jbowtie's answer. "7. Upgrade your home partition to ext4 (optional, see the Ubuntu wiki for details).
    – wdypdx22
    Aug 6, 2010 at 17:00
  • Does all that work fine if your $HOME is encrypted or this would make the transfer of files harder? Sep 16, 2011 at 4:21
  • It will be harder (you must mount the old encrypted home) and way, way slower. Transferring high amounts of data from one encrypted partition to another one is as slow as copying. While moving files within the same partition is near instantaneous (and independent of size). Sep 16, 2011 at 7:07
1

jbowtie has provided a comprehensive method. I would like to add to it.

Before installing the packages you need to make sure the /etc/apt/sources.list file is copied over to the new system followed by an apt-get update.

In addition to the apt packages don't forget any manually compiled packages and any manually downloaded .deb packages which may not be available in the sources. It might be useful to 'diff' the old backed up and the new bin folders to find these.

Better still it might be worth it to maintain a log of any manual operations to these system folders, enabling you to make the perfect clone.

-1

$ sudo tasksel remove desktop && sudo tasksel install desktop

That will remove all packages in the desktop set and then re-install them. This will have the side-effect of removing all packages that depend on them, providing you with the purge you mentioned wanting. You can see the package list using:

$ tasksel --task-packages desktop | less

1
  • Why the downvote? This sounds like a neat trick. Is there a problem with doing this? Feb 14, 2011 at 15:39
-1

I think you should wait for 10.10,BTRFS and such.

According to Phoronix Benchmarks,BTRFS just murdered the competition.

Phoronix UFS+J vs UFS+S vs ZFS vs Ext4 vs BTRFS

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .