Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: fedora 41 uses dnf5 and is no longer compatible with _dnf



On 7/29/24 4:55 PM, Han Boetes wrote:
Hi there,

fedora 40, using dnf3 used this nice db file with a list of all packages: /var/cache/dnf/packages.db

Alas, fedora 41 switched to dnf5 which no longer uses this file so:

    %  dnf install python3-
    No matches for: `dnf command' or `available package'

The current layout of the cache folder looks like this: % find /var/cache/libdnf5/rawhide-2d95c80a1fa0a67d/
/var/cache/libdnf5/rawhide-2d95c80a1fa0a67d/
/var/cache/libdnf5/rawhide-2d95c80a1fa0a67d/repodata
/var/cache/libdnf5/rawhide-2d95c80a1fa0a67d/repodata/repomd.xml
/var/cache/libdnf5/rawhide-2d95c80a1fa0a67d/repodata/b826501210413564ce176a21fac9732a065d87670422eaa2054ac1bc5ecb06c9-primary.xml.zck
/var/cache/libdnf5/rawhide-2d95c80a1fa0a67d/repodata/5c3ec73a978ca882d72f61c8484b3915d1690e89dc7a13f5951eb0de96b64940-comps-Everything.x86_64.xml.gz
/var/cache/libdnf5/rawhide-2d95c80a1fa0a67d/metalink.xml
/var/cache/libdnf5/rawhide-2d95c80a1fa0a67d/solv
/var/cache/libdnf5/rawhide-2d95c80a1fa0a67d/solv/rawhide-group.solvx
/var/cache/libdnf5/rawhide-2d95c80a1fa0a67d/solv/rawhide.solv
/var/cache/libdnf5/rawhide-2d95c80a1fa0a67d/packages
I can't help with writing new code for this problem, but I'll gladly help with testing. Cheers, Han




Briefly looked into it and it seems like the two cases that _dnf_query_db() handles can be replaced with dnf calls:

dnf --quiet --cacheonly repoquery --installed --queryformat='%{name}\n'
and
dnf --quiet --cacheonly repoquery --queryformat='%{name}\n'

the latter would get available package names or exit 1 should the cache not exist.

[root@c41423fd368f /]# dnf --quiet --cacheonly repoquery --queryformat='%{name}\n' zsh
Cache-only enabled but no cache for repository "rawhide"

I haven't tested what happens with multiple repos and one repo lacks it's cache though.





Messages sorted by: Reverse Date, Date, Thread, Author