September 27, 2024

Upgrading to Zorin 17

Gun to my head, time to upgrade.

Intro

The thing I love most about Linux is the stability.

Years ago, I had grown to hate Apple for asking me to allow minor updates, only to find out they had done massive app-breaking updates instead.

This was happening weekly until enough was enough. So, I switched to Linux and have been quite happy ever since.

After a brief run w/ Elementary, I moved to Zorin. Zorin 16 has been my home for the last 3 years, and it’s been pure bliss.

Problem

Over these same few years, a trend has been unfolding on Github w/ developers offering pre-built apps and games that you don’t have to compile.

This saves me a bunch of trouble, so I’ve been all for it.

But I’ve finally hit a wall. These pre-built apps no longer work on my machine, as I’ve been getting a dreaded error:

./QSS-M-l64: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found (required by ./QSS-M-l64)
./QSS-M-l64: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.34' not found (required by ./QSS-M-l64)

As it turns out, this GLIBC error is translated as “your OS is too old, and you are being left behind.” An error w/ GLIBC is the kiss of death.

Trying to compile these apps myself resulted in the same errors. Trying this guy’s tip for compiling an updated GLIBC didn’t work either.

Who knew a 3 year old OS was too old, but aparently that’s how it works in Linux world. You gotta keep moving w/ the herd.

So I’m prepping for my big update tomorrow to Zorin 17.

Migration

The reason I even make this post is to have a reason to share my migration shell script.

I presumptively will have to do this major OS upgrade every 2 years, so this is how I’m doing it. This solves the question of how to temporarily back up my stuff while I install a fresh OS, and then move it back.

Am not doing:

  • I’m not using the OS updater, bc I like the idea of a clean slate
  • I’m not using a backup app, bc it backs up my entire home directory (see point #1)
  • I’m not using my home server to store my files, bc internet connections are too slow for the amount of data I need to move

Am doing:

  • I’m using a 1TB external drive, which is super fast over USB3
  • I’m using RSYNC bc it’s awesome and can be run repeatedly w/out issues or wasted time

The script:

#!/bin/bash

BACKUP="/media/myuser/myexternaldrive"

# check if backup directory exists
if [ ! -d "$BACKUP" ]; then
    echo "Backup directory $BACKUP not found. Exiting."
    exit 1
fi

cd ~

# backup bashrc
cp ~/.bashrc ${BACKUP}/bashrc.txt

# backup crontab
crontab -l > ${BACKUP}/crontab.txt

# backup ssh folder
rsync -avh --delete --progress ~/.ssh/* ${BACKUP}/DOTSSH/

# backup documents
rsync -avh --delete --progress ~/Documents/* ${BACKUP}/Documents/

# backup music
rsync -avh --delete --progress ~/Music/* ${BACKUP}/Music/

# backup pictures
rsync -avh --delete --progress ~/Pictures/* ${BACKUP}/Pictures/

# backup videos
rsync -avh --delete --progress ~/Videos/* ${BACKUP}/Videos/

# backup downloads
rsync -avh --delete --progress ~/Downloads/* ${BACKUP}/Downloads/

# backup joplin
rsync -avh --delete --progress ~/.config/joplin-desktop ${BACKUP}/Notes/

# backup bottles
rsync -avh --delete --progress ~/.var/app/com.usebottles.bottles ${BACKUP}/Bottles/

# die early (comment off for database dump)
exit 1

# backup mysql databases
USER="myuser"
PASSWORD="mypass"
mysql -u$USER -p$PASSWORD -e 'SHOW DATABASES;' | grep -Ev "(Database|information_schema|performance_schema)" | while read dbname; do
    mysqldump ${dbname} > ${dbname}.sql --add-drop-table --lock-tables=false --user=$USER --password=$PASSWORD
done

rm -rf ${BACKUP}/Data/
mkdir ${BACKUP}/Data/
mv ~/*.sql ${BACKUP}/Data/.

Conclusion

Wish me luck. If I never post on here again, well… it means my upgrade failed.

UPDATE: It went really well. Only thing I forgot to backup was my Sublime Text settings file. The coolest thing about this was backing up the entire Bottles directory worked.

Notes

  • Don’t use compression on RSYNC bc it slows everything down.