Things to consider when doing a Linux upgrade

T

My Checklist for upgrading my Linux (Mint/Ubuntu)

This article is not a step by step tutorial but a general checklist when upgrading a Linux system. It’s based on Mint/Ubuntu, but can roughly be used for any other Linux distributions too. In the original version, I had 10 bullet points, but I grouped it for better readability.

In my opinion, checklists are a great thing when doing complex, lengthy or recurring stuff. They are timesaving and efficient for tasks you do once in a while or quite often, but not often enough to keep all doings in mind. When using checklists for a while it’s also funny or interesting to see, what comments I’ve made on single items and do not need anymore. To me, this is always a sign I’ve improved! 🙂

I really like my own checklists – and I do use the one for upgrading Linux every now and then – but sometimes checklists of others are a great tool as well. They can help you see what other people deem important, make you consider the unthought and help you understand their way of thoughts. Just seeing what other people put in their checklists was eye-opening on many occasions, and that’s why I’m sharing my Linux checklist with you.

0. Documentation

Continuous documentation is key. Whenever you change something in your Linux system outside your home directory, it should be backed up when upgrading. Write it all down in a file like MyAdaptions.txt.

1. Backup it up!

From my experiences, I can tell, you never know, what happens during an upgrade. We all experienced it one time or another and we know: everything is possible. And It’s best to be prepared for that. In German, there’s a saying „Mut kann man nicht kaufen…“ sometimes complemented with „…, aber Blödheit gibt’s gratis.“ which means: “You can’t buy courage, but stupidity is for free.”.

It’s up to you which of the following backup options you choose for your Linux System. Just keep in mind: It’s your data and it’s probably important so you may not want to demonstrate courage here.

Backup Options

You can go for a full image/snapshot or a partial backup when upgrading your Linux. Mostly, I prefer both backups together. Sometimes I just go for a partial backup to prevent loss of data or wasted time for feature x. Yeah, you know what I’m talking about: the one feature you painfully added to your system months ago and that could be gone after the upgrade. Don’t forget it.

Option A: Full image/snapshot of your system

Use your favourite imaging/snapshot-tool for a full backup.

  • Option B: Partial backup – back up only your home directory and other relevant config/data to an external device.

Here is, what I back up, when not doing a full backup. I do this typically with rsync and a varying amount of options e. g.:

sudo rsync -rcvlptgo --exclude=unimportant-directory /home/myuser /media/myuser/backup-dir/)
  • /home/myuser
    This includes bookmarks, browser and mail data, VPN connections, SSH keys, GPG keys …
  • /etc
    Back it up completely or select what you need in the specific dirs like cron jobs, apache/nginx config, fstab, resolv.conf, hosts …
  • Custom script adaption or tweaks you made inside system directories outside your home directory. Those should be documented inside MyAdaptions.txt e. g.:
    /usr/local/bin/ as mentioned in Documentation.
    Also consider backing up fonts, licenses or certificates, if you fear, they could get lost.
  • Dump your databases, if you have any.
    This could be either

    mysqldump -u root -p dbname > /media/myuser/backup-dir/dumps/dbname_timestamp.sql
    
    pg_dump -F c -f /media/myuser/backup-dir/dumps/dbname_timestamp.pgdump dbname

    or any dumping tool for your NoSQL database.

  • Make a screenshot of your Desktop, if you emphasize a specific arrangement of your items, most of the time the icons get mixed up. This is especially important if you’ve > 50 items on your Linux desktop and love that kind of organized chaos.
  • Save any additional custom program settings that are not stored inside your home dir like customized menu-bars, language settings, custom shortcuts etc. I recommend using a program’s export function, whenever available. I usually don’t do this very often anymore, because I like to browse the settings and features of a program’s newer version. This is also a good time to check if old settings are still needed or in need of change.
Option C: No backup at all

This is very brave and very stupid and not recommended at all.

 2. Do your research

Before upgrading, go to the website of your Linux distribution and see what upgrade info is provided for your version. You can additionally search the web for guides/checklists of whoever did that upgrade already. Doing that was always worth my time and saved me a lot of trouble in the long run.

Useful commands to find out your Linux/Distribution version could be:

uname -a
cat /proc/version
cat /etc/*-release
…

Those are some examples of tutorials I consulted lately:

3. Think about what you want – and give it a try!

Ask yourself if you really need / want to upgrade Linux.

Do you really need/want to upgrade your Linux system to a different version or are you satisfied with your (long time support) version and support is still there? Staying with your current version is an option to consider. Assuming you need/want the upgrade, ask yourself if you need to do it right now. If you are not that experienced and you are upgrading to a brand new release, it could be advantageous to wait for some experts to publish guides and report bugs.

Furthermore, you need to decide to which version you want to upgrade. This usually depends on the recommendations for your current Linux distribution. In my case, I had to upgrade from Linux Mint 18.1 to 18.3 first and then upgrade to 19.1 from there.

Try it out

If your research showed relevant kernel or other changes and your distribution provides a live CD/DVD/USB, try running it, before you upgrade. This gives you a live feeling of major changes, before using it.

Prepare your Computer

Updates before updates

Install all pending or recommended updates for your current Linux system before upgrading.

Reboot Linux

Restart your machine and stop potentially interfering stuff like Docker containers. In most cases, this won’t be a problem but it gave me some headaches and troubles once. I learned from that experience and I do reboot just before an upgrade just to make sure. Nothing beats an upgrade with a freshly rebooted system.

Using a notebook? Better plug it in.

Always check the battery status, before you’re upgrading Linux on a notebook. I recommend plugging it in during the upgrade process just to be sure. Yes there is a reason, why this point is here. Believe me. Sigh.

4. Inhale, exhale and follow the instructions

The time has finally come: Follow the instructions of your favourite step by step guide, take a deep breath and press “Upgrade to …” in your Update Manager. Depending on the Linux system you probably have to enter something like “apt update; apt upgrade”  into a terminal.

5. Test it!

After the Linux upgrade is complete, reboot and check the most important functions/programs. For me that’s usually:

  • network connections (especially WLAN, VPN),
  • handling of multiple monitors,
  • general check on multimedia input/output and different formats from music to videos,
  • battery-status and energy-management on notebooks,
  • does the resume or hibernate functionality work better or worse than after the last update,
  • do changes in files like .bashrc work as usual,
  • is my custom gnome-panel bootstrapping script still working,

If you have problems, remember you have a backup – unless of course you chose backup option C and tempted the gods of data 😉

I hope this checklist will help you with upgrading Linux on your computer. Feel free to share your own experiences and good luck with your upgrade.

 

 

Über den Autor

Karin Dunkl
Karin Dunkl

Karin Dunkl ist seit 2006 Software Entwicklerin bei artindustrial it. Sie ist Expertin für Software Architektur und Java Web Entwicklung.

Karin Dunkl Von Karin Dunkl

Hier finden Sie uns

Adresse
Mariahilferstrasse 111/6-7
1060 Wien
Kartenansicht

Öffnungszeiten
Montag – Freitag: 9–17 Uhr

Kontakt
Mail: office@artindustrial-it.com
Tel.: +43 1 5954023

Support

Hier finden Sie Unterstützung zu unseren angebotenen Services.

Folgen Sie uns