ZSystems/Upgrade SLES to openSUSE

Jump to: navigation, search

The LinuxONE Community Cloud provides only SLES, RHEL and Ubuntu as possible Linux distributions for devlopment/testing, more precisely, RHEL, ubuntu and SLES15 SP4 (this one is the prerequisite for this guide).


This tutorial guides you through upgrading your VM from the current SLES 15 service pack 4 to openSUSE Tumbleweed (ROLLING release as opposed to the (other) fixed SLES/openSUSE ones).

The SLES distribution for LinuxONE community instances has been updated to SLES 15 SP4 (as of Feb 2024).


Disable SLES

You can verify your SLES system with cat /etc/os-release.

sudo zypper services shows you the name of the service behind of all SLES repositories. You can disable them with zypper removeservice ${alias}.

Example:

sudo zypper removeservice SMT-http_lxslsmt

NOTE: Yields an error message that the service is not (no longer?) installed (but not critical as it's just an example anyway)

As all services in /etc/zypp/services.d are related to SLES (at the time of this writing, SLES 15-SP4 - grepping the files reveals this) AND we intend to upgrade to Tumbleweed anyway, it's justified to simply remove the config files for all services (AFTER having upgraded to Tumbleweed):

sudo su -
cd /etc/zypp/services.d
rm -rf *

Alternatively, the services.d directory can be moved to (e.g.) services.d.old and a new (empty) services.d directory created (analogous to the (old) repos.d directory, see below).

NOTE: Contrary to SP1/2, with SP4 (installed on LinuxONE instances - at least - from Sep 2023 onwards), there's no longer just one service installed and enabled, but several (around six or seven) of them. At least one of them causes the original SLES repos (and their contents!) to be pulled in even AFTER the upgrade/switch to Tumbleweed. This can be dangerous, as one may likely end up with a "mixed system" - some packages from SLES (downgraded from Tumbleweed) and others from Tumbleweed. Such a system may not boot properly anymore. As we don't have a web UI offering access to a serial (boot) console of our LinuxONE instances, this can be very hard to debug (and fix) and may likely require the setup of a new LinuxONE instance.

Long story short: Once your instance is running on Tumbleweed, none of these services are needed (anymore), as they're all related to SLES.

TBD: Verify that removing all files in /etc/zypp/services.d indeed is the better (because more straight forward) solution.

Upgrade to openSUSE Leap

SLES 15 SP1 requires the most current release (at the time of this writing, 15.5) of openSUSE Leap before upgrading to openSUSE Tumbleweed. NOTE: It is possible to skip this step with a preinstalled SLES 15 SP2 or higher, but it's likely still safer ("smoother" upgrade to Tumbleweed) to perform it nevertheless

  1. Verify your repositories:
sudo zypper repos --uri

NOTE: With a current LinuxONE instance, /etc/zypp/repos.d contains about 50(!) repo entries - even though not all of them are enabled, it's still a lot...

  1. Disabling a large(er) number of repositories at once
sudo mv /etc/zypp/repos.d /etc/zypp/repos.d.old
sudo mkdir /etc/zypp/repos.d 
  1. Add all required Leap repositories:
sudo zypper ar -f https://download.opensuse.org/distribution/leap/15.5/repo/oss/ "OSS Leap 15.5"
sudo zypper ar -f https://download.opensuse.org/distribution/leap/15.5/repo/non-oss/ "Non-OSS Leap 15.5"
  1. Verify your repositories:
sudo zypper repos --uri

zypper repo --uri checks for service<=>repo pairings/"connections". => As soon as all services have been removed, zypper repo --uri automatically deletes each (formerly) corresponding repo, as shown in the messages (TBD: are these service<=>repo associations SLES-specific or do/can they exist for openSUSE, too? => go figure):

hbarsles15sp4:/etc/zypp # zypper repos --uri
Warning: Unknown service 'Basesystem_Module_s390x': Removing orphaned service 
repository 'Basesystem_Module_s390x:SLE-Module-Basesystem15-SP4-Pool'
Removing repository 'SLE-Module-Basesystem15-SP4-Pool' 
................................................................................ ..................................................[done]
Warning: Unknown service 'Development_Tools_Module_s390x': Removing orphaned 
service repository 'Development_Tools_Module_s390x:SLE-Module-DevTools15-SP4- Debuginfo-Updates'
Removing repository 'SLE-Module-DevTools15-SP4-Debuginfo-Updates' 
.......................................................................................................................[done]
Warning: Unknown service 'Public_Cloud_Module_s390x': Removing orphaned service 
repository 'Public_Cloud_Module_s390x:SLE-Module-Public-Cloud15-SP4-Updates'
Removing repository 'SLE-Module-Public-Cloud15-SP4-Updates' 
.............................................................................................................................[done]
[...]

=> Indeed, ls -l /etc/zypp/repos.d doesn't show any entries (afterwards).

  1. Refresh for updates of the keys:
sudo zypper refresh
  1. Execute the upgrade:
sudo zypper dup --allow-vendor-change --force-resolution
  1. Reboot (that can require some time):
sudo reboot
  1. Verify that you're indeed running openSUSE leap:
grep -ci leap /etc/os-release

should return a number >= 1 after a successful upgrade to the Leap release of openSUSE.

  1. Ensure that there are no recommended packages left to be installed
sudo zypper inr
  1. Remove possible SLES leftovers:
rpm -qa | grep -i sle
sudo zypper remove gtk3-branding-SLE-15.0-150400.16.2.1 gtk2-branding-SLE-15.0-150400.13.7

(Pkgs mentioned in zypper remove invocation are only meant to be examples - your pkg names may vary.)

  1. Change baseproduct symlink to Leap (req'd for sudo zypper inr, as a warning clearly indicates):
hbarsles15sp4:/etc/products.d # rm baseproduct
hbarsles15sp4:/etc/products.d # ln -s Leap.prod baseproduct

(Changing the symlink is also import to prevent certain SLES-specific repos to be pulled in (again) by zypper inr, such as):

repo-sle-debug-update.repo
repo-sle-update.repo
  1. remove Leap-specific update repos:
sudo rm /etc/zypp/repos.d/repo-backports-*

rerun "sudo zypper inr"

(should NOT display a warning this time)

Upgrade to openSUSE Tumbleweed

  1. Remove Leap/SLES repos (only in case they're still around in /etc/zypp/repos.d):
sudo zypper rr 2
sudo zypper rr 1
  1. There's now a - relatively new - service for maintaining repos for a particular (open)SUSE release. In order to install it, curl or wget it, install it, and refresh all services:
wget https://download.opensuse.org/repositories/Base:/System/openSUSE_Factory/s390x/openSUSE-repos-Tumbleweed-20230810.a7534f6-25.6.s390x.rpm
sudo rpm -i openSUSE-repos-Tumbleweed-20230810.a7534f6-25.6.s390x.rpm
sudo zypper refs

=> should automatically obtain all required open source repos for "Tumbleweed".

NOTE: The date, git commit hash, and version strings in the RPM file name may vary! Please double check openSUSE Tumbleweed Base System Repo For s390x in order to be sure with regard to the current, exact package file name!

  1. Add NonOSS repos manually (as the service only adds the OSS repos upon being

refreshed by zypper refs):

sudo zypper ar -f http://download.opensuse.org/ports/zsystems/tumbleweed/repo/non-oss/ "Tumbleweed-NonOSS"
sudo zypper ar -f http://download.opensuse.org/ports/zsystems/source/tumbleweed/repo/non-oss/ "Tumbleweed-Source-NonOSS"
  1. ALTERNATIVELY, you can add Tumbleweed repositories manually (but the service-centric solution is the preferred one):
sudo zypper ar -f http://download.opensuse.org/ports/zsystems/tumbleweed/repo/oss/ "Tumbleweed-OSS"
sudo zypper ar -f http://download.opensuse.org/ports/zsystems/source/tumbleweed/repo/oss/ "Tumbleweed-Source"
sudo zypper ar -f http://download.opensuse.org/ports/zsystems/tumbleweed/repo/non-oss/ "Tumbleweed-NonOSS"
sudo zypper ar -f http://download.opensuse.org/ports/zsystems/source/tumbleweed/repo/non-oss/ "Tumbleweed-Source-NonOSS"
  1. Verify your repositories:
sudo zypper repos --uri
  1. Refresh for updating the keys:
sudo zypper refresh
  1. Execute the upgrade:
sudo zypper dup --allow-vendor-change --force-resolution
  1. Reboot (that may take some time):
sudo reboot
  1. Verify you're indeed running openSUSE Tumbleweed
uname -r

should - at least at the time of this writing - return a kernel version 6.6.x and

grep -ci tumbleweed /etc/os-release

should return a number >= 1

  1. Ensure that there are no recommended packages left to be installed
sudo zypper inr