Since Fedora 22, DNF has replaced Yum as the default package manager. But not all yum commands have been migrated.
Today I felt like querying what packages I installed explicitly, and a quick Google told me to use
yumdb search reason user, but it returned nothing.
I dug into the cause, and it turns out DNF now has its own yumdb (the database, not the command, sadly) at “/var/lib/dnf/yumdb”, along with yum’s “/var/lib/yum/yumdb”, and the command
yumdb uses the latter by default.
In the man page of yum.conf, it says the “persistdir” value controls the path of yum’s db files, and it defaults to “/var/lib/yum”; but,
yumdb --help tells me that it allows me to specify the location of config file. (Cheering for not touching /etc/yum.conf)
So, here’s what I did:
- Create a new fake config file with persistdir set to DNF’s folder.
echo '[main]\npersistdir=/var/lib/dnf' > /tmp/dnf.conf
- Calls yumdb with that config file.
yumdb -c /tmp/dnf.conf search reason user