How can I perform an in-place upgrade of openSUSE 42 to 15.x?
Before starting to experiment, it's a good idea to make a
precautionary backup in case things go wrong.
To back up the existing .repo
configuration files, do :
1
cd /etc/zypp/repos.d/ && sudo zip oss-42.2_orig.zip *.repo
How I upgraded openSUSE from 42.2 to 15.4 2
1. Refresh and update the existing openSUSE 42.2
Before upgrading, a crucial step is to run sudo zypper refresh
and
sudo zypper update
to refresh and update the current version of the
system.
:~> sudo zypper refresh
Retrieving repository 'oss' metadata ...........................[done]
Building repository 'oss' cache ................................[done]
Retrieving repository 'oss_update' metadata ....................[done]
Building repository 'oss_update' cache .........................[done]
All repositories have been refreshed.
:~> sudo zypper update
Loading repository data...
Warning: Repository 'oss_update' appears to be outdated.
Consider using a different mirror or server.
Reading installed packages...
The following 3 NEW packages are going to be installed:
kbd kmod pkg-config
The following 88 packages are going to be upgraded:
binutils command-not-found coreutils cpp48 curl dbus-1 …
…
yast2-xml zip zypper
88 packages to upgrade, 3 new.
Overall download size: 96.8 MiB. Already cached: 0 B. After the operation,
additional 7.8 MiB will be used.
Continue? [y/n/...? shows all options] (y): y
As indicated in the output dump above, I chose y
to start the
update.
This started the download and installation of the latest package
versions of openSUSE 42.2.
Retrieving package emacs-info-24.3-24.6.1.noarch (1/91), 4.2 MiB
Retrieving: emacs-info-24.3-24.6.1.noarch.rpm .............[done (1.7 MiB/s)]
Retrieving package file-magic-5.22-7.6.1.x86_64 (2/91), 334.5 KiB
Retrieving: file-magic-5.22-7.6.1.x86_64.rpm ..........................[done]
…
Retrieving package wicked-service-0.6.40-6.6.1.x86_64 (91/91), 58.6 KiB
Retrieving: wicked-service-0.6.40-6.6.1.x86_64.rpm ....................[done]
Checking for file conflicts: ..........................................[done]
( 1/91) Installing: emacs-info-24.3-24.6.1.noarch .....................[done]
( 2/91) Installing: file-magic-5.22-7.6.1.x86_64 ......................[done]
…
(91/91) Installing: wicked-service-0.6.40-6.6.1.x86_64 ................[done]
Additional rpm output:
Failed to connect to bus: No such file or directory
…
Output of coreutils-8.25-2.3.1.x86_64.rpm %posttrans script:
Please run mkinitrd as soon as your system is complete.
Now that openSUSE Leap 42.2 has been successfully refreshed and
updated,
it's time to start upgrading to openSUSE Leap 15.4.
2. Change the version numbers in the .repo
configuration files
A. In /etc/zypp/repos.d/oss.repo
, replace 42.2/repo/oss/suse
with 15.4/repo/oss
:
sudo sed -i 's|42.2/repo/oss/suse|15.4/repo/oss|g' /etc/zypp/repos.d/oss.repo
:~> cat /etc/zypp/repos.d/oss.repo
[oss]
enabled=1
autorefresh=0
baseurl=http://download.opensuse.org/distribution/leap/15.4/repo/oss/
type=rpm-md
B. In /etc/zypp/repos.d/oss_update.repo
, replace 42.2
with 15.4
:
sudo sed -i 's|42.2|15.4|g' /etc/zypp/repos.d/oss_update.repo
:~> cat /etc/zypp/repos.d/oss_update.repo
[oss_update]
enabled=1
autorefresh=0
baseurl=http://download.opensuse.org/update/leap/15.4/oss/
type=rpm-md
3. Synchronize the list of packages and versions available
:~> sudo zypper refresh
Retrieving repository 'oss' metadata ...........................[done]
Building repository 'oss' cache ................................[done]
Retrieving repository 'oss_update' metadata ....................[done]
Building repository 'oss_update' cache .........................[done]
All repositories have been refreshed.
4. Perform the distribution upgrade
:~> sudo zypper dist-upgrade
Warning: You are about to do a distribution upgrade with all enabled
repositories. Make sure these repositories are compatible before you
continue. See 'man zypper' for more information about this command.
Loading repository data...
Reading installed packages...
Computing distribution upgrade...
14 Problems:
…
Problem: nothing provides (kmod(sg.ko) if kernel)
needed by suse-module-tools-15.4.12-150400.1.4.x86_64
Solution 1: deinstallation of suse-module-tools-12.4-3.2.x86_64
Solution 2: keep obsolete suse-module-tools-12.4-3.2.x86_64
Solution 3: break suse-module-tools-15.4.12-150400.1.4.x86_64
by ignoring some of its dependencies
Choose from above solutions by number or skip, retry, cancel [1/2/3/s/r/c]: 1
OK? What should I do now?
As indicated in the output dump above, I chose
deinstallation of suse-module-tools-12.4-…
A new Problem was displayed.
Problem: nothing provides (/usr/sbin/useradd or busybox)
needed by sysuser-shadow-3.1-150400.1.35.noarch
Solution 1: deinstallation of rpcbind-0.2.3-3.3.1.x86_64
Solution 2: keep obsolete rpcbind-0.2.3-3.3.1.x86_64
Solution 3: break sysuser-shadow-3.1-150400.1.35.noarch
by ignoring some of its dependencies
Choose from above solutions by number or skip, retry, cancel [1/2/3/s/r/c]: 1
Again, I chose deinstallation … (rpcbind-0.2.3-3.3.1.x86_64).
This went on and on.
Sometimes, deinstallation was presented as Solution 2.
I continued to choose deinstallation for the following packages:
patterns-openSUSE-base-20150918-27.1.x86_64
,
man-2.6.6-6.3.1.x86_64
,
emacs-24.3-24.6.1.x86_64
,
udev-228-25.18.1.x86_64
,
util-linux-2.28-12.9.1.x86_64
,
systemd-228-25.18.1.x86_64
,
libutempter0-1.1.6-7.55.x86_64
,
openssh-7.2p2-11.6.1.x86_64
,
emacs-nox-24.3-24.6.1.x86_64
,
gpm-1.20.7-9.53.x86_64
,
systemd-sysvinit-228-25.18.1.x86_64
,
util-linux-systemd-2.28-12.9.1.x86_64
,
sysconfig-netconfig-0.84.0-1.2.x86_64
,
aaa_base-13.2+git20140911.61c1681-24.3.1.x86_64
,
kmod-17-10.3.1.x86_64
,
screen-4.0.4-7.21.x86_64
,
sysconfig-0.84.0-1.2.x86_64
,
wicked-0.6.40-6.6.1.x86_64
,
kmod-compat-17-10.3.1.x86_64
,
libwicked-0-6-0.6.40-6.6.1.x86_64
,
ruby-common-2.1-6.3.1.noarch
,
wicked-service-0.6.40-6.6.1.x86_64
,
yast2-packager-3.1.123-5.6.1.x86_64
,
aaa_base-extras-13.2+git20140911.61c1681-24.3.1.x86_64
,
yast2-ruby-bindings-3.1.51.2-3.1.x86_64
,
yast2-3.1.217-5.6.1.x86_64
,
yast2-country-data-3.1.32-1.2.x86_64
,
ruby-2.1-4.2.x86_64
,
yast2-hardware-detection-3.1.7-9.5.x86_64
,
yast2-transfer-3.1.3-1.3.x86_64
.
After answering deinstallation for that last package, a lot of
output followed.
Resolving dependencies...
Computing distribution upgrade...
The following 96 NEW packages are going to be installed:
bash-sh blog boost-license1_66_0 branding-openSUSE … vim-data-common
The following NEW product is going to be installed:
"openSUSE Leap 15.4"
The following 45 packages are going to be REMOVED:
aaa_base aaa_base-extras emacs emacs-nox gpm kmod … yast2-transfer
The following pattern is going to be REMOVED: base
The following product is going to be REMOVED: openSUSE
The following 198 packages are going to be upgraded:
augeas bash bc bind-utils binutils bzip2 ca-certificates … zypper
The following pattern is going to be upgraded: minimal_base
The following 26 packages are going to be downgraded:
acl fillup insserv-compat klogd libacl1 libaio1 libattr1 … unzip zip
The following 4 packages are going to change architecture:
file-magic x86_64 -> noarch
linux-glibc-devel noarch -> x86_64
openssl x86_64 -> noarch
perl-XML-NamespaceSupport x86_64 -> noarch
The following 217 packages are going to change vendor:
acl openSUSE -> SUSE LLC <https://www.suse.com/>
…
zypper openSUSE -> SUSE LLC <https://www.suse.com/>
198 packages to upgrade, 26 to downgrade, 96 new, 45 to remove, 217 to
change vendor, 4 to change arch.
Overall download size: 189.6 MiB. Already cached: 0 B. After the operation,
additional 293.0 MiB will be used.
Continue? [y/n/...? shows all options] (y): y
I chose y
, and the download and installation started.
Retrieving package boost-license1_66_0-1.66.0-12.3.1.noarch (1/320), 20.8 KiB
Retrieving: boost-license1_66_0-1.66.0-12.3.1.noarch.rpm ..............[done]
Retrieving package branding-openSUSE-15.4.20220322-lp154.2. (2/320), 11.6 KiB
…
Retrieving package device-mapper-1.02.163-150400.15.95.x (320/320), 143.7 KiB
Retrieving: device-mapper-1.02.163-150400.15.95.x86_64.rpm ............[done]
Checking for file conflicts: ..........................................[done]
( 1/363) Installing: boost-license1_66_0-1.66.0-12.3.1.noarch ........[done]
Additional rpm output:
warning: /var/cache/zypp/packages/oss/noarch/boost-license1_66_0-1.66.0-12.3.
1.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 39db7c82: NOKEY
( 2/363) Installing: …
…
(362/363) Removing kmod-17-10.3.1.x86_64 ..............................[done]
(363/363) Removing suse-module-tools-12.4-3.2.x86_64 ..................[done]
…
Output of rpm-4.14.3-150300.46.1.x86_64.rpm %posttrans script:
migrating rpmdb from /var/lib/rpm to /usr/lib/sysimage/rpm...
I saw lots of warnings, of which the most common was
No such file or directory
.
The download and installation took about 7 minutes.
5. Check the new current version of openSUSE
:~> sudo zypper repos
Repository priorities are without effect.
All enabled repositories share the same priority.
| Alias | Name | Enabled | GPG Check | Refresh
--+-----------------------------+-------------+---------+-----------+--------
1 | oss | oss | Yes | (r ) Yes | No
2 | oss_update | oss_update | Yes | (r ) Yes | No
3 | repo-backports-debug-update | Update re-> | No | ---- | ----
4 | repo-backports-update | Update re-> | Yes | (r ) Yes | Yes
5 | repo-sle-debug-update | Update re-> | No | ---- | ----
6 | repo-sle-update | Update re-> | Yes | (r ) Yes | Yes
…
Check the version :
:~> cat /etc/os-release
NAME="openSUSE Leap"
VERSION="15.4"
…
6. Rebuild the caches for the system repositories
:~> sudo zypper refresh
Repository 'oss' is up to date.
Building repository 'oss' cache ................................[done]
Repository 'oss_update' is up to date.
Building repository 'oss_update' cache .........................[done]
New repository or package signing key received:
Repository: Update repository of openSUSE Backports
Key Fingerprint: …
…
Do you want to reject the key, trust temporarily, trust always? [r/t/a/?]: t
Retrieving repository 'Update repository of openSUSE Backports'metadata[done]
Building repository 'Update repository of openSUSE Backports' cache ...[done]
New repository or package signing key received:
Repository: Update repository with updates from SUSE Linux Enterprise 15
Key Fingerprint: …
…
Do you want to reject the key, trust temporarily, trust always? [r/t/a/?]: t
Retrieving repository 'Update repository with updates from SUSE Linux E[done]
Building repository 'Update repository with updates from SUSE Linux Ent[done]
All repositories have been refreshed.
7. Upgrade installed packages to their newest available versions 3
Then I ran sudo zypper update
.
-bash-4.4$ sudo zypper update
Loading repository data...
Reading installed packages...
The following 125 packages are going to be upgraded:
augeas bind-utils binutils ca-certificates-mozilla curl … zypper
The following 7 NEW packages are going to be installed:
libisc1606 libjitterentropy3 libutempter0 libzck1 … util-linux
The following 2 packages are going to be REMOVED:
bind-libs hardlink
125 packages to upgrade, 7 new, 2 to remove.
Overall download size: 102.2 MiB. Already cached: 0 B. After the operation,
additional 1.7 MiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Of course, I chose y
.
The download and installation of the Update followed.
Retrieving package sysuser-shadow-3.1-150400.1.35.noarch (1/132), 12.9 KiB
Retrieving: sysuser-shadow-3.1-150400.1.35.noarch.rpm .................[done]
Retrieving package system-group-hardware-20170617-150400.… (2/132), 12.4 KiB
Retrieving: …
…
Retrieving package util-linux-2.37.2-150400.8.8.1.x86_64 (132/132), 1.3 MiB
Retrieving: util-linux-2.37.2-150400.8.8.1.x86_64.rpm .................[done]
Checking for file conflicts: ..........................................[done]
( 1/132) Installing: sysuser-shadow-3.1-150400.1.35.noarch ...........[done]
/usr/sbin/groupadd -r render
/usr/sbin/groupadd -r sgx
( 2/132) Installing: …
…
(132/132) Installing: util-linux-2.37.2-150400.8.8.1.x86_64 ...........[done]
Executing %posttrans scripts ..........................................[done]
8. The battle between http:
and https:
In my experience, replacing http:
with https:
in the
/etc/zypp/repos.d/*.repo
files,
can cause an error.
When I do this – and then run sudo zypper refresh
– I often
(but not always) get :
4
:~> sudo zypper refresh
Download (curl) error for 'https://download.opensuse.org/distribution/…':
Error code: Curl error 60
Error message: SSL certificate problem: certificate has expired
Apparently, this is a problem with expired certificates.
The risk of getting such a Curl error
is likely much smaller once an
upgrade has been successfully completed, including refreshing and
updating the system.
Summary
It's prudent to repeat the initial precautionary backup :
cd /etc/zypp/repos.d/ && sudo zip oss-15.4_orig.zip *.repo
It's far from obvious which choices to make during an upgrade like
this.
But it seems the upgrade worked for the most part.
And cat /etc/os-release
says the version is now
openSUSE Leap 15.4.
I still get Access is denied. Press Enter or Esc to exit...
every
now and then, when I try to start openSUSE-15 via ConEmu.
I don't know if this issue is related to ConEmu, but I've never seen
it when I start openSUSE-15 directly from CMD.exe,
wsl ~ -d openSUSE-15
.
5
References
1
To see the contents of the oss-42.2_orig.zip
file,
run unzip -l oss-42.2_orig.zip
.
To restore the .repo
files :
cd /etc/zypp/repos.d/ && sudo rm *.repo && sudo unzip oss-42.2_orig.zip
2
Support Data Base: System upgrade is the single most
important reference I used to perform the upgrade.
3
At this point, the openSUSE distro hang and didn't respond to any
input from the keyboard.
When I restarted, it looked as follows.
-bash: /etc/profile: No such file or directory
-bash-4.4$
After installing Snap as described here, and restarting
again, that behavior went away.
The prompt resumed to looking normal again, like so :
henke@hp:~>
I don't know exactly what fixed the system.
And I don't know how to replicate the problem.
4
To replace http:
with https:
in all .repo
files, run :
sudo sed -i 's/http:/https:/' /etc/zypp/repos.d/*.repo
5
If you haven't changed the name of the distro, you should start it as
wsl ~ -d openSUSE-42
, even though the distro contained is
openSUSE 15.