The Safety of Do-Release-Upgrade in Ubuntu
My experience with do-release-upgrade is that it rarely breaks anything, so I would say it is generally a safe and reliable way to upgrade Ubuntu.
By. Jacob
Edited: 2021-11-06 09:48
You might be wondering if the do-release-upgrade command is safe to use, and whether you are going to loose data if you upgrade your installation of Ubuntu. Luckily, this is very rarely the case. In this tutorial, I will try to give you my experiences with the command, after having used Ubuntu since around 2012.
So, I have used Ubuntu for many years, and while I have tried other distributions, I just keep coming back to Ubuntu. Later I switched to Kubuntu, but this fact should not mean anything for this Tutorial.
I always use the latest version of Ubuntu, and generally I avoid staying on the LTS versions for too long when there is a newer normal release. This has rarely caused any problems, and if there has been something wrong, it has usually been something minor, like needing to re-install software for my touchpad, or occasional broken dependencies because package maintainers has not yet updated their packages.
Note. There is no guarantee that package maintainers will update their packages; some might only focus on the LTS version of Ubuntu, and then you need to find workarounds for those specific issues on your own. Alternatively, check if you can support the package maintainer by donating money — this will not only help yourself, but everyone else that rely on the package as well.
More recently I had a serious problem that crippled me at least for a weak before I found a solution — but even then, it was actually more or less my own fault — you can read about what happened in this article: Configuring VirtualBox with Host-only and NAT Adapter
Performing the system upgrade:
sudo do-release-upgrade
Is do-release-upgrade safe?
The most common problem I have had is that I have had to re-install something that was suddenly missing after the update.
It should be mentioned, performing a do-release-upgrade might sometimes change the installed software, but this is easily fixable in my experience.
I have a lot of services running for testing, such as MySQL, PHP, Postfix. Etc. These are usually left unaffected, but if something does happen, it should, again, be very simple to fix any issue that might arise.
The beauty of Linux is, it is extremely easy to do "hard" and "complex" tasks, such as operating a mail or web server from your home. The software usually works out-of-the-box, with minimal changes to the configuration, and if something happens to break, you can just get re-install or fix the configuration. Luckily, this has not happened to me very often.
If you are a system administrator, and still hesitant about updating, then I highly recommend you install a virtual machine of Linux and experiment. Another option would be to make a copy of your "vital" system, and then try to perform the update in a VirtualBox, to see what needs to be fixed (if anything) after performing the upgrade command.
Data loss when upgrading is unlikely
While it may sometimes modify your install packages, installing the latest versions, this should rarely cause any problems, and if you are missing applications you should easily be able to re-install them.
Your personal files, such as those usually located in /home/, /opt/ or /usr/local/, will be untouched.
Linux has "standard" locations for storing users data, and if you stick to using those directories for the purposes they were meant, you should generally be safe. However, there might be some differences between different distributions, as to where they allow you to keep your personal files.
Upgrading to the latest version
By default, LTS releases will only be upgraded to other newer LTS releases when running the do-release-upgrade command, which might result in the message: No new release found.
To fix this, we use nano to edit the /etc/update-manager/release-upgrades file, changing the prompt variable from LTS to normal:
sudo nano /etc/update-manager/release-upgrades
This should look like:
Press [CTRL] + [O] to save the file, then [CTRL] + [X] to exit nano.
You should now be able to upgrade to the latest version of Ubuntu the next time you run the do-release-upgrade command.
Links
- Upgrading - ubuntu.com
Tell us what you think: