7

I just want to delete EVERYTHING except maybe /home folder and reinstall everything, because system became a little bit slow and I want to do that when 14.04 comes out. What's the best way to do that?

At the moment I have 12.04 and have some other systems (cinamon, lubuntu etc.) that I want gone.

Parto
  • 15,685

3 Answers3

12

What if you're using a modern release of Ubuntu Desktop (or flavor) and don't see an Upgrade/Repair existing installation option?

The option still exists on releases up to and including Ubuntu 22.10, but it's not offered as an easy to click option, and needs to be manually triggered.

This option will allow you to

  • repair an installation (ie. re-install the same release)
  • upgrade to a later release (ie. next release, or even skip releases)
  • go backwards to a prior release (ie. you didn't like a later release, and want to revert to something older; though there can be consequences with this, which I won't cover, but it's possible & problems will not occur in many cases; issues are package level basis, so do your homework before you expect a backwards install will be good for you)
  • you're installing a Ubuntu system over a non-Ubuntu, but other GNU/Linux OS, this will work too (within limits).

Assuming you're using a Desktop installer (namely ubiquity (used by Ubuntu Desktop & many flavors, including Kubuntu which uses a different skin which changes how it looks), or calamares (used by modern Lubuntu or Ubuntu-Studio)) this will work. I'm not covering a di (Debian installer for server or desktop alternate ISO) or subiquity server installer, you will

  • Choose the Manual option, which may appear as
    • Something Else
    • Manual Partitioning
  • Select your existing partition(s).

Note: You do not need to have a separate /home partition for Ubuntu Desktop to have your settings & datafiles survive re-install; this works equally with a single partition for all supported releases of Ubuntu (most unsupported too).

Ensure you DO NOT format any, the lack of format for "/" is what triggers the REPAIR or RE-INSTALL option I'm talking about here.

The installer will

  • take note of your manually installed packages (ie. those you added to your system post-install)
  • erase system directories (if you have some server apps installed; as they store configs in system directories, you may suffer loss here, but it won't impact desktop applications)
  • install the new system (from your booted live media)
  • if internet is available install the extra packages noted earlier
  • ask to reboot (and won’t touch any user files unless you formatted)

This is QA (Quality Assurance) tested to work with all Ubuntu repository software only (not 3rd party), so no guarantees are offered with 3rd party, and I'm choosing to ignore 3rd party apps for this 'answer'.

The user is asked to reboot, where you'll be able to login & see your older desktop configs, the additional apps (manually installed packages you'd added) also re-installed, and be able to load your favorite music player & continue playing your existing playlists as if the re-install didn't occur.

(FYI: I use clementine as example in the Understanding Lubuntu QA Testcases document as it's a non-standard app for Lubuntu, and thus allows me to confirm it got re-installed correctly as I perform other post-install checks during QA; all your Ubuntu repository apps should re-install where available).

Notes:

I've used this to migrate a Fedora system to Ubuntu, as well as an older OpenSuSE Leap system to Ubuntu. As Fedora & OpenSuSE are rpm based (not deb based), no manually installed packages will get auto-reinstalled. ie. this will work for converting any GNU/Linux system to Ubuntu, as long as the Ubuntu installer can cope with the file-system that is used.

I've also used it for Debian systems very regularly, though as packages never really align for Debian & Ubuntu, I'd suggest erasing system directories manually prior to the install process to avoid having the re-install attempt to re-install packages for the non-Ubuntu system that cannot be found (ie. avoiding the error messages on unfound packages). If your system was a non-Ubuntu system, please do not file bugs on unfound packages (such bug reports will be invalid).

I've also used this to switch a Linux Mint system to Ubuntu. Before I trust a new (second hand) box I use it for a week or two before I start my real install. I used Linux Mint (& FreeBSD as I dual boot systems) to test my old primary box during this 'hardware' testing, but decided there was some pieces of the Linux Mint I really liked & wanted to survive into my install, so I opted to do an unclean install instead of my intended clean (ie. format) install. As I wanted a clean package system (no Linux Mint packages attempted to be re-installed), I just erased all system directories that contained data I didn't want to survive, so the install of Ubuntu (17.10 at the time) didn't detect a prior OS, but without format, the parts I wanted to survive remained. FYI: The FreeBSD system used a non-Ubuntu compatible file-system, thus I didn't attempt to re-use that & did a format install over that system.

I'm involved with QA, as well as heavily involved with one flavor in particular, thus keep systems of all supported releases available for support reasons. For many of those, I never actually perform the normal upgrades of packages, but use this install method to re-install as it accomplishes two tasks at once, ie. a QA test is performed & I check it still works for unreleased media, as well as updating the packages on my support installs. Currently the releases that get this approach are jammy (currently using 22.04.2 daily media; ie. unreleased) & lunar. When I no longer need an install for support, I'll use this install method to convert it to another release (ie. 21.10 reached EOL, that install became 22.10 as I already had a 22.04 system)

I like to think of this Repair Installation option as Upgrade via re-install, though Lubuntu refer to it as Upgrade using existing partition. I tend to think of this as my backup for release-upgrades if I lack time, don't have sufficient disk space (as system directories are wiped, no downloads occurs; a pretty full disk isn't the issue it is with normal release-upgrades), or just if I lack the time to do the release-upgrade.

It can be used with encryption, though I won't support it with full disk encryption (very easy to make mistakes here); if your system uses Data Partition encryption (home folder which used to be a default install for older releases like 17.10 I mentioned earlier), you can still use this install method very easily. For home partition encryption, you need only to add the encryption packages (not default any more thus not included on modern ISOs) to the live system prior to starting the installer, then start the installer & install normally.


Update for Ubuntu Desktop 24.04 & 24.10

What is described above will work with releases up to and including Ubuntu Desktop 23.10, where ubiquity (and ubuntu-desktop-installer for 23.04 & 23.10) were available. In the noble cycle a new feature of ubuntu-desktop-provision was added to the ubuntu-desktop-installer which caused a problem reported here

To get around the problem encountered; a FORMAT is forced for ubuntu-desktop-installer installs for 24.04 & later, which means the non-destructive re-install talked about in this question is no longer possible for Ubuntu Desktop 24.04 LTS & later, and any flavors that use that installer.

Ubuntu flavors using calamares installer however will not have a forced format; thus Lubuntu, Kubuntu and Ubuntu Unity can still use the method described in this answer.

FYI: My QA of installs included installing one flavor (eg. Lubuntu), making changes to make it my own system including adding music, non-standard music player, changing wallpaper & other options etc.. Then I'd non-destructively re-install a different desktop (eg. Ubuntu Desktop) so as to which the LXQt desktop to GNOME as provided by Ubuntu Desktop; I'd expect my data files to exist (even where a single partition install was used) plus my non-standard music player was there to continue my created music playlist. I'd then re-install & switch GNOME to Xfce via non-destructive install using Xubuntu media... again existing no data loss & my manually installed apps remain... I'd do other flavors too if I had time, before finally re-installing the Lubuntu system I started with; where I expect ALL my configuration changes (desktop wallpaper, WM changes etc, plus music & non-standard music player) to be there; ie. I've returned to my adjusted configured system despite numerous installs... I could do this until late in the noble or 24.04 cycle without issue. It is hoped in time this type of re-install will return to ubuntu-desktop-installer, but resources need to be available to correct the issue that is currently avoided by a forced format

guiverc
  • 33,923
  • 1
    Ubuntu 23.04 is expected to use the new Desktop Installer (called canary for prior releases), where I've not yet had a successful install using this install method, but it's hoped & expected that will be rectified prior to Ubuntu lunar becoming Ubuntu 23.04. Don't expect this install method to work with older releases though if using the canary installer. – guiverc Jan 23 '23 at 23:58
  • Further to last comment; I've now had successful a successful re-install with the new Ubuntu Desktop installer too using Ubuntu lunar (or 23.04). I'm writing the latest ISO currently to test that again... – guiverc Mar 09 '23 at 02:24
  • Do note: There can be differences between releases if using this install method and Ubuntu Desktop with universe packages involved (which I suspect most of us use). As flavors have 'universe' installed by default there is no issue, but Ubuntu Desktop does not have it enabled by default; thus if you want 'universe' packages to install, you may need to add that repository & sudo apt update prior to starting the installer for many releases where using Ubuntu Desktop (if you want those to re-install automatically). This is not required for all releases though. – guiverc Apr 10 '23 at 08:42
  • A problem has been encountered during noble QA and it maybe this re-install feature will be disabled for noble ; at least at release (it maybe able to be fixed as subiquity can be upgraded without re-spinning ISOs).. https://bugs.launchpad.net/ubuntu-desktop-provision/+bug/2058638/comments/5 Where 23.04 & 23.10 had ubiquity ISOs available as alternatives; Ubuntu Desktop & many flavors will only have ubuntu-desktop-installer for noble – guiverc Mar 25 '24 at 21:23
  • Installers have changed; Ubuntu Studio no longer uses calamares having switched to ubuntu-desktop-installer (see prior comment which still applies), but Kubuntu and Ubuntu Unity now also use calamares. – guiverc Aug 25 '24 at 23:00
  • Installing 24.10 over 23.04 did not preserve any files as far as I can see. Also, baffling to see how they could release an installer as buggy as the one I just used. I must have experienced about 10 separate serious bugs in the UI alone, leading me to restart the process about as many times, not to mention the fact that it completely failed the first install with "we don't know what went wrong". I know it says "Google" on the tin, but still... Amusing to watch. – Andreas Oct 31 '24 at 00:22
  • I've successfully used it to install 24.10 over 23.04 & 23.10 without issue using ISOs using the calamares installer; however as mentioned in my prior comments, a forced format still occurs on 24.04 & 24.10 if using the ubuntu-desktop-installer ISOs, thus it could only be used on earlier releases using that installer (ie. 23.04, 23.10 before ubuntu-desktop-provision was added). The current Desktop installer has been available as canary since 19.10 and became ubuntu-desktop-installer or default at 23.04, so isn't exactly new @Andreas You cannot format and preserve files. – guiverc Oct 31 '24 at 01:58
  • Sorry but I don't find any mention of either 24.04 or 24.10 in any comment above, let alone in the answer, so I don't know exactly what part you're referring to when you say you've mentioned it. Also couldn't find any mention of "forced format". I did find a mention that it has worked: "successful re-install with the new Ubuntu Desktop installer too using Ubuntu lunar (or 23.04)". I did not claim that the installer was new, and the fact that it's not doesn't exactly make the situation better. – Andreas Oct 31 '24 at 02:18
  • Ubuntu noble became 24.04, and I specifically mentioned a bug discovered in 24.04 during QA (https://bugs.launchpad.net/ubuntu-desktop-provision/+bug/2058638/) which meant a non-destructive re-install with what was then noble resulted in a system that wouldn't login without a manual fix; which caused the forced-format for noble or what became 24.10. The answer, and my comments relating to 24.04 were pre-release thus I used the noble name (Mar 25, 2024 was pre-release of 24.04 by a ~month). The answer was written (as requested) in Jan 2023 so latest release was Ubuntu 22.10 – guiverc Oct 31 '24 at 02:22
  • Right, I forgot the codename, thanks! Anyway, I see the mention that "maybe this re-install feature will be disabled for noble", which I read as pertaining to the new installer (because, as I understood it, noble would only come with the new installer?), so I thought I'd confirm that the new installer doesn't work in 24.10 either. Not sure about how the noble codename relates to 24.10 but I'm not that familiar with the version evolution and naming processes. I think there are just too many installers, versions and flavors for me to keep track of here... Well, clearly; I tried and failed. – Andreas Oct 31 '24 at 02:55
  • FYI: oracular is the codename for 24.10 (letters increment; N for 24.04, O for 24.10, and P or plucky is 25.04). The hope was forced format would be removed for oracular (24.10), but it's a low-priority fix and thus will happen when resources allow for it (thus format is forced for now, and thus non-destructive re-installs aren't yet possible for ubuntu-desktop-installer ISOs beyond 23.10) Lubuntu, Ubuntu Unity & Kubuntu use the calamares installer for 24.04 & later... @Andreas – guiverc Oct 31 '24 at 03:05
  • 1
    When the ubuntu-desktop-provision fix has been completed; you'll be able to take advantage of it using existing ISOs (eg. 24.04 Desktop) by updating installer prior to starting the install, however the fix doesn't yet exist.. – guiverc Oct 31 '24 at 03:06
4

How you re-install Ubuntu over an existing older version depends on if you have /home in a separate partition or as a folder within / partition, the default.

In either case you start the installation process from a live DVD/USB. Proceed until you come to the Installation Type page.

enter image description here

If you have /home in its default location within / partition:

Choose the option: Upgrade Ubuntu 12.04 LTS to 14.04 LTS. This will keep your /home folder. Even though it says "installed software will be kept where possible," in my experience it cleared most of them. YMMV.

If you have /home in its own separate partition:

You can either go with the above choice.

Or you can choose Something else. If you choose "Something else," make sure you check the format box for the / partition and uncheck the format box for /home partition. See below for an example.

enter image description here

Note, in this picture above both the / and /home partitions are to be formatted. Make sure that the format box for /home is unchecked before you proceed. Otherwise you will lose all your data!

This method will format the / partition and all the extra programs you had installed in the older version will be gone. However, the settings saved in the /home will remain. If you decide to re-install some of them, say Chrome, your personal configuration, if any, should be there for the new installation to use.

Removing Cinamon and Lubuntu

It depends on how you installed Cinamon Lubuntu etc.

If you had installed just the cinamon desktop environments (DE) and the LXDE (the DE for Lubuntu) on top of Ubuntu via Ubuntu Software Center, or the apt-get command, then yes. Either method will delete them.

If you installed these from their own LiveDVD/CD/USB in separate partitions, then no. In that case you will have to remove those partitions first. You can remove these partitions either from the LiveDVD/USB, by choosing the option Try before installing and then using gparted. Make sure you don't delete the wrong partitions. At this stage you can move the other partitions around if needed and reallocate the empty space to the version of Ubuntu you want to keep.

Hope this helps

user68186
  • 37,795
  • When using Something Else partions are not set be formatted by default. You need to click Change, choose the to use/mount a partition, and then check or not check format. – chaskes Apr 10 '14 at 20:30
  • @user68186 will it delete cinamon, lubuntu etc.? also, will system become faster you think? thanks – mrSuperEvening Apr 11 '14 at 12:52
  • @mrSuperEvening It depends on how you installed cinamon lubuntu etc. If you had installed just the cinamon desktop environments (DE) and the LXDE on top of Ubuntu via Ubuntu Software Center, or the apt-get command, then yes. Either method will delete them. If you installed these from their own LiveDVD/CD/USB in separate partitions, then no. In that case you will have to remove those partitions first and reallocate the empty space to Ubuntu during the Something else stage of reinstall. – user68186 Apr 11 '14 at 15:24
  • @user68186: and do you think system will become faster? thanks. – mrSuperEvening Apr 11 '14 at 17:42
  • This is hard to say. In general Linux does not become slow over time in my experience like Windows. However, I have experienced slowdown at start-up and shut-down after I had installed something. So it is possible removing all the old stuff will make it faster. If you search for upgrade versus fresh install, you will find many prefer a fresh install to reduce the accumulated junk. In any case, 14.04 is supposed to be faster than 12.04. So it will be hard to say in the end. – user68186 Apr 11 '14 at 18:03
3

Just reinstall it over itself.

Ubuntu will not touch your data in /home and you'll start off with a clean slate. Just ensure that "Format" is not selected in your partition screen.

You can reinstall it in the same fashion as you installed:

Let me reiterate to ensure that you do not reformat your partition! And as with all system upgrades and reinstalls, having a fresh backup is always a good precaution to take.

You might have some things in your home directory that could be leading to performance degradation. In the past I've had config files in my home directory in directories like .gconf and .gnome that ended to get large and unweildy. These days things like that aren't as much of an issue.

Jorge Castro
  • 73,907