How to in-place upgrade from openSUSE 15.2 to 15.3

Following along in my line of “Readers Digest” versions of the official Opensuse upgrades procedures (here are a couple of my past ones: 11.1, 11.2, 11.4, 12.1, 12.2, 12.3, 13.1, 13.2, 42.1, 42.2, 42.3, 15.0, 15.1, and 15.2)… Here’s the latest for upgrading in-place from openSuse 15.2 to 15.3 below. Just be sure to run each of these lines one-at-a-time, not like a script.

And please… if you don’t know what you’re doing, please don’t do this. This process does not take many special conditions into account, since it is a simplified version. There’s a link at the end for the official documented instructions if you need further help. Now, let’s get to it:

#
# Run the following as the root user, or insert all your sudo commands if you like
# Tip: Make a snapshot before you proceed!
# Tip: Use "screen" to run the dup
# Tip: Ensure you have space to do an upgrade (the /boot requires more space these days)! "df -h"
# Tip: Check your version, to know what your upgrading from and to: "more /etc/SUSE-brand"
# If you can, do a final update (if the repos still exist):
zypper ref;zypper up
# Now check for custom repos (note it for later if so), and make sure update repo is set and enabled before upgrading:
zypper lr --url
# Check to see repos defined in /etc/zypp/repos.d/ (e.g. hard-coded to 15.2), or using the $releasever variable. 
# If they are still hard-coded with a particular Leap version number, then you need to modify them first:
more /etc/zypp/repos.d/*
# (IF NEEDED) Replace Leap repos defined in /etc/zypp/repos.d/ are using the $releasever variable:
# sudo sed -i 's/15.2/${releasever}/g' /etc/zypp/repos.d/*.repo
# ...or, if you previously messed it up... 
# sudo sed -i 's/${releasever}/15.2/g' /etc/zypp/repos.d/*.repo 
# ...Otherwise, you may need to manually replace whatever is there.
# Next, switch and refresh all repositories to new (new method):
zypper --releasever=15.3 ref
# Verify the repos are set with variable:
zypper lr --uri
# Finally, do the Distribution UPgrade... and I like the option to download all the packages first, before installation (if space is available)...
zypper --releasever=15.3 dup --download-in-advance
# And now that the upgrade is done, add back any custom repos at this point (optional, depends on your environment) 
# (optional) And I'm not sure why, but on some of my systems grub did not get configured, so I had to:
# grub2-mkconfig -o /boot/grub2/grub.cfg
# And reboot (and watch from a console)...
init 6

A special note from commenter David Greaves in a previous post (thanks!): Experimentation shows that the ${releasever} is also not substituted (in 15.1 at least) in the [repo name] area. Maybe include: The releasever defaults to the current release so you only need to use it on the command line when you’re doing distribution upgrade commands. After rebooting it will take the new value. Finally your guides don’t rename the .repo files – but now we can have versionless names so maybe mention that in the comments.

My advice is to make sure you have multiple terminal sessions during the upgrade, in case something goes a little strange, and make sure you have space for the kernel and all the files (especially if you have small /boot partitions).

Thanks to the folks at Suse; and here’s the thorough and detailed guide that I adapted this from:
https://en.opensuse.org/SDB:System_upgrade

Cool!

Leave a Comment

Your email address will not be published. Required fields are marked *