Score:1

reinstall ubuntu mate 21.10 without losing data

in flag

how can I reinstall ubuntu mate 21.10 without losing my data and installed packages.

cocomac avatar
cn flag
Do you have a separate home partition? And what is "my data"? Your home folder? Every config file you've ever edited? Can you elaborate a bit? Thanks!
Score:2
cn flag

You can I believe; it's a QA-test install I perform at least weekly with Lubuntu (it's a QA testcase for them).

It's called "Install using existing partition" in the Lubuntu testcases; but this type of install works with all flavor and I use it myself with Ubuntu-MATE on occasion too. See https://discourse.lubuntu.me/t/testing-checklist-understanding-the-testcases/2743 and search for "Install using existing partition" for what I've written there; where you'll note I refer to non-standard packages (clementine or a music player) & some music as examples of packages QA-testers can look for.

You perform the following steps

  • backup all data (it's easy to make a mistake)
  • boot the media you want to install
  • start ubiquity installer
  • select existing partition(s) but ensure you do NOT have format ticked for any

This will cause

  • installer will note your manually installed packages
  • erase system directories
  • install the new system
  • if internet is available install the extra packages noted earlier (you need internet available!)
  • ask to reboot (and won’t touch any user files unless you formatted)

This type of install is triggered by the lack of format.

It works with Ubuntu repository software; sorry in QA-testing only Ubuntu repository software is used, so I have little experience with it on 3rd party software. Personally I remove all 3rd party sources prior to using this install so it works cleanly if it's my own box; and add the 3rd party myself later.

It also allows you to change release; ie. I used this install because I was lazy & just upgraded 18.04 systems to 20.04 without using do-release-upgrade as it takes a fraction of the time & has the ~same result (sure metadata shows I re-installed; but the effect to me is identical! if I ignore datestamps on files & contents of history etc).

I only pass the QA-test installs WHERE packages installed prior (and I'm talking about pre-installed non-default packages from Ubuntu repositories) get re-installed. It's worked on all releases of Ubuntu-MATE (for other releases I've used it back to Ubuntu 11.04 if not further back)

ps: for at least one of my 18.04 to 20.04 installs; I'd used encrypted-partition which was a default on the initial install (maybe 17.10) but is no longer offered by default. For that machine I had to add a package during the live session before I started the installer (ubiquity) to ensure the system knew how to handle the encrypted partition, but outside of that apt install it was the same.

N0rbert avatar
zw flag
Looks good. Just tested this method. It saves home folder of previous user. To save/restore list of applications I would suggest to run my [*srslsud* script](https://github.com/N0rbert/srslsud) on backup stage as `./srslsud.py all_save` on external media and then restore applications using `./srslsud.py all_load` on the reinstalled system. This will give complete picture.
in flag
Thank you. I think this is exactly what i'm looking for. I've made 2 generations of backups using Clonezilla so now I'm ready try on the 3rd drive. I'm an electrical design engineer and now someone who plays around with the system. All I want is for it to reliably run my engineering applications. The patches and the over-the-air upgrades have made the system unreliable so I want to re-install the OS without having to reconfigure everything. Again, thanks.
Score:0
ng flag

You can't.

Ubuntu is really just a collection of installed packages. Even if you reinstall the operating system in top of your existing installation, many of those packages will be overwritten.

Most user-generated data and many packages will be unaffected, but not all of them. There is no guarantee that your personal data and configurations will not be overwritten.

Additionally, reinstalling the OS without formatting might not even solve whatever problem has caused you to reinstall. It could actually spawn new problems if newly installed packages conflict with older files and configs that are not removed.

If you feel you need to reinstall the OS to fix some problem you can't otherwise solve, then you may as well do a wipe and a clean installation. Reinstalling is usually the exhaustive action you take when all else fails, so it doesn't really make much sense to do it "dirty". In either case, back up your data.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.