Upgraded Linux Mint 20.2 to 20.3 Using Terminal Only
Today I upgraded our two Linux Mint machines form v20.2 Uma to 20.3 Una. I did the upgrades over SSH and at the command line, which is not recommended by the Linux Mint team or community. The preferred upgrade process is through the Linux Mint Update Manager, and I am not suggesting that anyone do otherwise. This post simply documents what I did instead. The references section below contains documentation on the “correct” way to upgrade as well some third party guidance closer to what I did from LinuxCapable.
Upgrade to Linux Mint 20.3
Before I began, our two Linux Mint machines were happily running Linux Mint 20.2. It is generally good practice to make sure machines are up to date and backed up before embarking on significant changes. Do not proceed further until you have done this.
I backup the Linux Mint machines with local snapshots scheduled regularly via Timeshift. In addition I backup critical directories to my NAS on a daily basis using rsync, as mentioned previously in this post. For me it was a matter of making sure both backups had already completed for the day before beginning, and they had.
SSH to machine to Upgrade
I had Two machines to update in different rooms and on different floors, so I decided to do both at the same time from the room I am in and the machine I am at. To do this I used ssh to connect to each machine in a split tmux window. I did this by opening a tmux window, issuing an
ssh gibson command, split the window into a second pane, and in it issued an
ssh steve command. Gibson and steve are the host names of the two machines I am upgrading. At this point I have a single screen split in two with a connection to both of the machines, one in each pane.
Bring All Updates Current
While I also push updates to all our computers on a daily basis using Salt, new updates could have become available since the early morning update push.
In the top pane with the ssh connection to the first machine, I ran a
sudo apt update command in the terminal and recieved a
All packages are up to date. messsage. Had I instead reveived a message indicating updates were available, I would also have run
sudo apt upgrade to apply missing package updates.
I repeated the update check in the second pane with the connection to the second machine, also finding
All packages are up to date.
Modify APT Source to Repository for New Version
The next step, done in both panes on both machines, was to update the package repository source configuration file from v20.2 uma to v20.3 una. This can be done using a text editor, but I opted to use sed to do an in-inline search and replace of “uma” with “una” in the the existing repository configuration file. This is the command I used:
sudo sed -i 's/uma/una/g' /etc/apt/sources.list.d/official-package-repositories.list
Update Apt and Run dist-upgrade
After updating the package repository as indicated in the previous step, I again issued a
sudo apt update command in the connection to each machine. This time both machines did not report all packages were up to date, but instead each machine has more than 100 hundred packages that needed to be upgraded.
I issued a
sudo apt dist-upgrade command both panes connected to the machines being upgraded. After about five minutes, both machines had completed downloading and applying all the package updates.
The moment of truth. I issued a
sudo reboot command in each pane, restarting both machines and terminating the ssh connections. Both machines began pinging again after about 20 seconds. I then reconnected via ssh to each machine and used a
neofetch command on each to see that the machines were updated. The neofetch output is available in the screenshot at the top of this post.
Things turned out well this time, and that is where I will leave this post.
You can use a Mastodon accounti to comment on this article by replying to the associated Mastodon toot.