Stuck in distribution upgrade inbetween leap 15.6 to 16.0 (zypper error while loading shared libraries: librpm.so.8)

Hi

I started succesfully the distribution upgrade with only (manually) with only these 3 repos:

zypper addrepo http://cdn.opensuse.org/distribution/leap/16.0/repo/non-oss "openSUSE:neu_16_0:repo-non-oss"
zypper addrepo http://cdn.opensuse.org/distribution/leap/16.0/repo/oss  "openSUSE:neu_16_0:repo-oss"
zypper addrepo http://codecs.opensuse.org/openh264/openSUSE_Leap "openSUSE:neu_16_0:repo-openh264"

and then

zypper --releasever 16.0 dup --auto-agree-with-licenses

Everything went fine untill installing rpm:

( 683/4944) Installieren: rpm-4.20.1-160000.2.2.x86_64 ..........................................................................................................................................[fertig]
warning: Found bdb_ro Packages database while attempting ndb backend: using bdb_ro backend.
warning: /var/cache/zypp/packages/openSUSE:neu_16_0:repo-oss/x86_64/p11-kit-tools-0.25.5-160000.2.2.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 09d9ea69: NOKEY
warning: Found bdb_ro Packages database while attempting ndb backend: using bdb_ro backend.
warning: Converting database from bdb_ro to ndb backend
error: cannot add record originally at 1847
warning: failed to rebuild database: original database remains in place
warning: Found bdb_ro Packages database while attempting ndb backend: using bdb_ro backend.
error: cannot open Packages database in /usr/lib/sysimage/rpm

It did not rebuild the rpm database. So I did that only step manually for rpm-4.20.1-160000.2.2.x86_64.rpm:

# cd /root
wget http://cdn.opensuse.org/distribution/leap/16.0/repo/oss/x86_64/rpm-4.20.1-160000.2.2.x86_64.rpm
rpm -Uvh --force rpm-4.20.1-160000.2.2.x86_64.rpm
# make a bakup of rpm, then rebuilddb
cd /var/lib/rpm
cp -r /usr/lib/sysimage/rpm /usr/lib/sysimage/rpm.bak
cd /var/lib/ 
rpm --rebuilddb
# seems all right

Then I get stuck:

zypper --releasever 16.0 dup --auto-agree-with-licenses
zypper: error while loading shared libraries: librpm.so.8: cannot open shared object file: No such file or directory

How can I resolve it or what can I do, to proceed the distribution upgrade?

Thanks for any help,
regards
Infinite_Dao

It looks like you’ve got a mix of packages from 15.6 and 16.0 installed - librpm.so.10 is from Leap 16, librpm.so.8 is from Leap 15.6.

It seems you’ve got the version of RPM from 15.6 and the version of RPM from Leap 16, which doesn’t provide the library needed by the version of zypper from 15.6.

I would probably revert to the pre-upgrade snapshot and run the upgrade again, probably doing some verification on the database before starting.

Otherwise, you could try installing the 15.6 release of rpm and see if that lets you move forward.

Yes. Well the distribution upgrade got stuck in step 683 of 4944. Now the 16.0 version of rpm-4.20.1-160000.2.2.x86_64.rpm is installed. It is probably a mix of rpm-interdepended packages but I don’t which are related to what and if I could resolve only the clean rpm-basic installation. How can I resolve it, or find out why the system or which package searches for the old librpm.so.8 from 15.6, although the new rpmis basically installed. Can I update manually the rpm-related package(s) that cause trouble that search for the old librpm.so.8?

PS.: I do not have any snapshot of the old system (I know … the documentation tells me to do backups beforehand … but unfortunately it is what is is now, and I try to solve it as good as possible)

So repos are Leap 16 only now? Confirm with
zypper lr -u

If you’re happy all is well then
sudo zypper ref
zypper dup --allow-vendor-change --allow-downgrade --replacefiles

yes, only the 3 repos from above. Thanks for the suggestion with the zypper commands but right now it is not working

zypper lr -u
zypper: error while loading shared libraries: librpm.so.8: cannot open shared object file: No such file or directory

So it is stuck with the rpm unresolved issue at the moment. Is it possible to resolve this rpm-package mingle-mangle :thinking:

Sorry, now I get where you’re at. Something to try…Boot a live ISO, and from a shell do

mount /dev/sdaX /mnt   # root partition of target system
mount --bind /dev /mnt/dev
mount --bind /proc /mnt/proc
mount --bind /sys /mnt/sys
chroot /mnt /bin/bash

You’ll have to try installing the packages (downloaded from an intenret connected PC) using the ‘rpm’ command. That can lead to dependency hell so YMMV. You’ll need to invoke something like

rpm -Uvh --force --nodeps rpm-libs-*.rpm rpm-*.rpm libzypp-*.rpm libsolv1-*.rpm zypper-*.rpm

Core packages:

rpm
rpm-libs
rpm-build
libsolv1
libzypp
zypper

This won’t be an exact science - more like a desperate attempt to bootstrap the package manager and finish the upgrade.

These are the installed packages in my running 15.6:

# zypper se -si zyp rpm
...
S  | Name                    | Type    | Version                | Arch   | Repository
---+-------------------------+---------+------------------------+--------+-----------
i  | libzypp                 | package | 17.37.18-150600.3.82.1 | x86_64 | UpdateSLE
i+ | python3-rpm             | package | 4.14.3-150400.59.16.1  | x86_64 | UpdateSLE
i  | python311-rpm           | package | 4.14.3-150400.59.16.1  | x86_64 | UpdateSLE
i  | rpm                     | package | 4.14.3-150400.59.16.1  | x86_64 | UpdateSLE
i  | rpm-config-SUSE         | package | 1-150400.14.3.1        | noarch | OSS
i  | ruby2.5-rubygem-gem2rpm | package | 0.10.1-3.45            | x86_64 | OSS
i  | systemd-rpm-macros      | package | 16-150000.7.42.1       | noarch | UpdateSLE
i  | zypper                  | package | 1.14.94-150600.10.52.1 | x86_64 | UpdateSLE
i+ | zypper-log              | package | 1.14.94-150600.10.52.1 | noarch | UpdateSLE

and source of librpm.so.8:

# rpm -qf /usr/lib64/librpm.so.8
rpm-4.14.3-150400.59.16.1.x86_64

Are these core packages the core packages from 16.0 or from 15.6? I guess for 16.0, right?

You need to use the Leap 16 versions of those packages. That’s what you’re trying to upgrade to right?

They’ll come from here:
https://download.opensuse.org/distribution/leap/16.0/repo/oss/x86_64/

OK. yes, that’s my attempt. I will try.

The reality is you may find other packages that need to be installed or updated, so this might take further work.

In http://cdn.opensuse.org/distribution/leap/16.0/repo/oss/x86_64/ I cannot find rpm-libs. Is rpm-libs part of 16.0 or am I looking at the wrong folder? My guess is, rpm-libs is not part of 16.0 or is it?

A mistake on my part. Ignore that, just the rpm package.

All right, would these packages then cover the rpm core and zypper core for 16.0?

# cd /root 
wget http://cdn.opensuse.org/distribution/leap/16.0/repo/oss/x86_64/rpm-4.20.1-160000.2.2.x86_64.rpm
wget http://cdn.opensuse.org/distribution/leap/16.0/repo/oss/x86_64/rpm-build-4.20.1-160000.2.2.x86_64.rpm
wget http://cdn.opensuse.org/distribution/leap/16.0/repo/oss/x86_64/libsolv1-0.7.34-160000.2.2.x86_64.rpm
wget http://cdn.opensuse.org/distribution/leap/16.0/repo/oss/x86_64/libzypp-17.37.17-160000.1.2.x86_64.rpm
wget http://cdn.opensuse.org/distribution/leap/16.0/repo/oss/x86_64/libzypp-17.37.18-160000.1.1.x86_64.rpm
wget http://cdn.opensuse.org/distribution/leap/16.0/repo/oss/x86_64/zypper-1.14.93-160000.1.2.x86_64.rpm

rpm -Uvh --force --nodeps \
  rpm-*.rpm \
  libzypp-*.rpm \
  libsolv1-*.rpm \
  zypper-*.rpm

Or do I need also include rpm-config-SUSE-20250328-160000.2.2.noarch.rpm from the /noarch folder? The reason I’m asking, I tried with the AI to find answers, but I’m also very cautious because it is often only 70-100% right and it suggested to also include rpm-config as a core library, thats why I’m asking.

So I tried to resolve the rpm-“core” packages:

# I tried rpm … --test before and it was all right so, I really executed then the update command:
rpm -Uvh --force --nodeps  \
  rpm-*.rpm \
  libzypp-*.rpm \
  libsolv1-*.rpm \
  zypper-*.rpm
# warning: package libzypp-17.37.17-160000.1.2.x86_64 was already added, replacing with libzypp-17.37.18-160000.1.1.x86_64
# Verifying...                          ################################# [100%]
# Preparing...                          ################################# [100%]
# Updating / installing...
#    1:rpm-4.20.1-160000.2.2            ################################# [ 13%]
# Updating /etc/sysconfig/services ...
#    2:libzypp-17.37.18-160000.1.1      ################################# [ 25%]
#    3:zypper-1.14.93-160000.1.2        ################################# [ 38%]
#    4:rpm-build-4.20.1-160000.2.2      ################################# [ 50%]
#    5:libsolv1-0.7.34-160000.2.2       ################################# [ 63%]
# Cleaning up / removing...
#    6:zypper-1.14.94-150600.10.52.1    ################################# [ 75%]
#    7:libzypp-17.37.18-150600.3.82.1   ################################# [ 88%]
#    8:rpm-4.20.1-160000.2.2            ################################# [100%]

and it seems all right :heavy_check_mark:.

Testing zypper reports:

zypper lr -u
zypper: error while loading shared libraries: libyaml-cpp.so.0.8: cannot open shared object file: No such file or directory

… ✘ seems the next missing dependency.

Again — Trying to resolve libyaml-cpp.so.0.8:

wget https://download.opensuse.org/distribution/leap/16.0/repo/oss/x86_64/libyaml-cpp0_8-0.8.0-160000.2.2.x86_64.rpm
rpm -Uvh --force --nodeps --test libyaml-cpp0_8*.rpm
# Updating / installing...
#    1:libyaml-cpp0_8-0.8.0-160000.2.2  ################################# [100%]

seems all right :heavy_check_mark:

Testing zypper:

zypper lr -u
# Die Repository-Prioritäten sind ohne Effekt. Alle aktivierten Repositorys teilen sich die gleiche Priorität.

# #  | Alias                           | Name                                        | Enabled | GPG Check | Refresh | URI
# ---+---------------------------------+---------------------------------------------+---------+-----------+---------+-------------------------------------------------------------------------------------
# ...
#  6 | openSUSE:neu_16_0:repo-non-oss  | openSUSE:neu_16_0:repo-non-oss              | Ja      | (r ) Ja   | Nein    | http://cdn.opensuse.org/distribution/leap/16.0/repo/non-oss
#  7 | openSUSE:neu_16_0:repo-openh264 | openSUSE:neu_16_0:repo-openh264             | Ja      | (r ) Ja   | Nein    | http://codecs.opensuse.org/openh264/openSUSE_Leap
#  8 | openSUSE:neu_16_0:repo-oss      | openSUSE:neu_16_0:repo-oss                  | Ja      | (r ) Ja   | Nein    | http://cdn.opensuse.org/distribution/leap/16.0/repo/oss
# ...

zypper seems working , hopefully all right :heavy_check_mark:.


So is now the time to try zypper dup right away? Or should I check some rpm-database stuff before?

My try would be to proceed with the distribution upgrade via: zypper --releasever 16.0 dup --auto-agree-with-licenses. Would it work (fingers crossed :sweat_smile:) ?

I did so far — aiming to come to the point, that zypper and rpm can work it out:

  1. stuck from rpm not rebuilding the database, download rpm-4.20.1-160000.2.2.x86_64.rpm manually, backup of rpm-data directory, rebuild rpm database. Was all right
  2. attempting resolve the Leap 16.0 rpm-core libraries and zypper’s core libraries, in my case these were (in summary):
  • with rpm -Uvh --force --nodeps …

    • rpm-4.20.1-160000.2.2.x86_64.rpm
    • libsolv1-0.7.34-160000.2.2.x86_64.rpm
    • libzypp-17.37.17-160000.1.2.x86_64.rpm, libzypp-17.37.18-160000.1.1.x86_64.rpm
    • zypper-1.14.93-160000.1.2.x86_64.rpm
  • here zypper lr -u turned out to complain about libyaml, which was old as of 15.6

    • libyaml-cpp0_8-0.8.0-160000.2.2.x86_64.rpm
  • here zypper lr -u was working, but zypper --gpg-auto-import-keys ref was complaining of librpmio.so.8, and following AI recommendations I confirmed (by querying rpm -q libsolv-tools-base libsolv-tools that 2 packages are old, then checking for new ones …)

    • libsolv-tools-0.7.34-160000.2.2.x86_64.rpm, libsolv-tools-base-0.7.34-160000.2.2.x86_64.rpm
  • I did rpm … --test … in general, then the real rpm install thing

  1. zypper --gpg-auto-import-keys ref was all right
  2. zypper --releasever 16.0 dup --dry-run --allow-vendor-change # was looking all right
  3. zypper --releasever 16.0 dup --download-in-advance --allow-vendor-change # was looking all right

Now it runs, and I hope that it will run through all right — lets see :sweat: …

It might be more fruitful to download installation media and do an in-place upgrade from media. That would give you a cleaner starting point. If the full offline install media isn’t feasible due to bandwidth or other reasons, the net install media would also be a reasonable choice.

But if your 15.6 was installed with btrfs, you should have snapshots enabled automatically for a rollback - if you can, take a look at the output of the mount command and see what the root partition filesystem is.

Now zypper ran through and it seemed all right, but after reboot it is stuck after reached target bluetooth support and goes into rescue mode.

So it seems that I know need a bootable USB-Live system to do somehow the chroot.

journalctl -xb in rescue mode reports Unit default.target not found how can I reset it correctly?

I’m in the default rescue mode now with root password, and systemctl get-default reported the error

Failed to get default target: Link has been severed

I did

systemctl set-default graphical.target

and then I typed exit from rescue mode and it resumed to lounch. Yipeee :grinning:

It starts now , and I hope it stays that way.

Thanks for all the hints pointing me to some where to start with.

2 Likes