How to in-place upgrade from openSUSE 15.1 to 15.2

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, and 15.1)… Here’s the latest for upgrading in-place from openSuse 15.1 to 15.2 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.1), or using the $releasever variable (new method):
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.1/${releasever}/g' /etc/zypp/repos.d/*.repo
# Switch and refresh all repositories to new (new method):
zypper --releasever=15.2 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.2 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

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!

4 Comments

  1. Raul Trujillo

    I’ve upgraded. However, when I do a “cat /etc/os-release” I still get my previous upgrade info.

  2. Jeremy Pavlov (Post author)

    @Raul – Interesting.. try “cat /etc/SUSE-brand”… did your upgrade actually succeed to the next version? And did you *only* go to the very next version (such as .1 to .2)? If you follow my steps, you have to make sure that “$releasever” replacement is done, or it won’t move to the next version. My old way was hard-coded replacement of like “15.0” to “15.1”, but now with the new “$releasever” variable, you don’t need to do that as long as the repo files really have the variable in them and not the specific version. I hope that helps…

  3. Raul Trujillo

    Jeremy, thanks for replying. I moved to the next version, from 15.1 to 15.2. cat /etc/SUSE-brand gives me the same thing. I may try to move to the .3 soon. I did notice, however, that my Samba shares stopped working. It may have been because during the install some things were deprecated and it gave me the option to remove or leave installed. I decided to remove them.

  4. David Greaves

    Hi
    Very useful especially for my minimal servers 🙂

    I notice after:
    # Switch and refresh all repositories to new (new method):
    zypper –releasever=15.2 ref
    # Verify the repos are set with variable:
    zypper lr –uri

    You also need the –releasever set for the zypper lr to give a meaningful result.

    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.

    HTH

Leave a Comment

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