Closed justrico closed 6 months ago
@Gobidev Could this be related to https://github.com/Macchina-CLI/libmacchina/issues/154?
Yes, openSUSE uses the ndb
database backend for RPM, which is why the file /var/lib/rpm/rpmdb.sqlite
doesn't exist and the package count fails. It might be possible to work around this by switching the backend to sqlite
manually:
To change the RPM database backend, you need to edit the /usr/lib/rpm/macros file and set the %_db_backend macro to the desired value (such as sqlite or ndb). You may also need to rebuild the RPM database using rpmdb --rebuilddb. However, note that changing the RPM database backend is not recommended unless you have a specific reason to do so. It may cause compatibility issues with other tools that rely on the RPM database format.
When trying this on openSUSE Tumbleweed, I got warning: invalid %_db_backend: sqlite
when trying to rebuild the database, so it looks like their build of RPM comes without sqlite
support.
Like I said in https://github.com/Macchina-CLI/libmacchina/issues/154, the ideal solution would be to somehow get a package count out of the ndb
database, but this is a lot of work. Spawning an rpm
process is not really an option for libmacchina, as it takes ~500ms to execute on a modern system.
Thanks for the confirmation.
I'm not particularly motivated to work on an implementation for the ndb
database, because (1) I'd probably write something that's even slower than spawning the corresponding process and (2) I don't use SUSE technologies. I'm not opposed to including a new dependency for this, though.
This was fixed in https://github.com/Macchina-CLI/libmacchina/pull/159, although the rpm-devel
package will need to be installed for the detection to work once it is available in macchina.
Describe the bug openSUSE Tumbleweed on WSL2 didn't display zypper packages.
To Reproduce Steps to reproduce the behavior:
Expected behavior Expect macchina to show up zypper packages.
Screenshots
macchina --doctor
outputSystem Information
wsl --version
)