How do I get out of this one? Yast SW management cannot read the list of installed packages.
It happened after I ‘installed’ the ‘Plan’ application (Calligra Plan?) using the Gnome ‘Software’ package application. The application did not start after it was installed, so I thought there might be some missing dependencies and added the repository ‘KDE extra’. From that moment everything went pear-shaped.
I am using OpenSuse 13.2 (64-bit) / Gnome 3.14.2
Immediately after starting the SW manager from the Yast GUI the log contains
sudo tail /var/log/YaST2/y2log
2015-10-09 22:41:03 <1> linux-lueh(11941) [liby2] genericfrontend.cc(main):783 Exiting with client return value '`next'
2015-10-09 22:41:03 <1> linux-lueh(11941) [zypp] PathInfo.cc(recursive_rmdir):435 recursive_rmdir /var/tmp/zypp.DpBIyN
2015-10-09 22:41:03 <1> linux-lueh(11941) [zypp++] TmpPath.cc(~Impl):78 TmpPath cleaned up /var/tmp/zypp.DpBIyN{d 0700 0/0}
2015-10-09 22:41:03 <1> linux-lueh(11941) [zypp] ZYppFactory.cc(_openLockFile):166 Open lockfile /var/run/zypp.pid
2015-10-09 22:41:03 <1> linux-lueh(11941) [zypp] ZYppFactory.cc(~ZYppGlobalLock):115 Cleanned lock file. (11941)
2015-10-09 22:41:03 <1> linux-lueh(11941) [zypp] ZYppFactory.cc(_closeLockFile):184 Close lockfile /var/run/zypp.pid
2015-10-09 22:41:03 <2> linux-lueh(11941) [qt-ui] YQUI.cc(qMessageHandler):725 <libqt-warning> QObject::~QObject: Timers cannot be stopped from another thread
2015-10-09 22:41:03 <1> linux-lueh(11941) [Pkg] PkgFunctions.cc(~PkgFunctions):158 Releasing the zypp pointer...
2015-10-09 22:41:03 <1> linux-lueh(11941) [Pkg] PkgFunctions.cc(~PkgFunctions):160 Zypp pointer released
2015-10-09 22:41:03 <1> linux-lueh(11941) [Y2Ruby] binary/YRuby.cc(~YRuby):107 Shutting down ruby interpreter.
‘sudo zypper clean -a’ fails with the following message
error: rpmdb: fop_read_meta: /var/lib/rpm/Packages: unexpected file type or format
error: cannot open Packages index using db4 - Invalid argument (22)
error: cannot open Packages database in /var/lib/rpm
Target initialization failed:
Rpm Exception
Cannot clean installed packages cache because of an error.
Some of the repositories have not been cleaned up because of an error.
I have not tried the other command. Should I anyway?
You can try “rpmdb --rebuilddb”, but I don’t think it can repair that, as all data from the main database is missing.
I think the only way to repair that (except for removing /var/lib/rpm/ and reinstalling all packages) is to restore a backup from /var/adm/backup/rpmdb/. If you’re lucky that’s quite recent…
OK. I did that and Yast works again! Many thanks for your help!
One last thing though…
Now I have three packages that want to be updated with newer versions all from the main update repository. These three updates fail with e.g.
Subprocess failed. Error: RPM failed: error: rpmdb: fop_read_meta: /var/lib/rpm/Name: unexpected file type or format
error: cannot open Name index using db4 - Invalid argument (22)
warning: /var/cache/zypp/packages/download.opensuse.org-update/x86_64/dracut-037-17.24.1.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID 3dbdc284: NOKEY
error: rpmdb: fop_read_meta: /var/lib/rpm/Name: unexpected file type or format
error: rpmdb: fop_read_meta: /var/lib/rpm/Name: unexpected file type or format
error: rpmdb: fop_read_meta: /var/lib/rpm/Name: unexpected file type or format
error: rpmdb: fop_read_meta: /var/lib/rpm/Group: unexpected file type or format
error: cannot open Group index using db4 - Invalid argument (22)
error: rpmdb: fop_read_meta: /var/lib/rpm/Requirename: unexpected file type or format
error: cannot open Requirename index using db4 - Invalid argument (22)
error: rpmdb: fop_read_meta: /var/lib/rpm/Providename: unexpected file type or format
error: cannot open Providename index using db4 - Invalid argument (22)
error: rpmdb: fop_read_meta: /var/lib/rpm/Conflictname: unexpected file type or format
error: cannot open Conflictname index using db4 - Invalid argument (22)
error: rpmdb: fop_read_meta: /var/lib/rpm/Obsoletename: unexpected file type or format
error: cannot open Obsoletename index using db4 - Invalid argument (22)
error: rpmdb: fop_read_meta: /var/lib/rpm/Dirnames: unexpected file type or format
error: cannot open Dirnames index using db4 - Invalid argument (22)
error: rpmdb: fop_read_meta: /var/lib/rpm/Installtid: unexpected file type or format
error: cannot open Installtid index using db4 - Invalid argument (22)
error: rpmdb: fop_read_meta: /var/lib/rpm/Sigmd5: unexpected file type or format
error: cannot open Sigmd5 index using db4 - Invalid argument (22)
error: rpmdb: fop_read_meta: /var/lib/rpm/Sha1header: unexpected file type or format
error: cannot open Sha1header index using db4 - Invalid argument (22)
By the way, the three packages are dracut (above), timezone and timezone-java