Package managers, package databases, compatibility, interoperability...?

Patience please… I’m sure this will sound like a naive question to many of you…

Is there only one package database structure, format, or architecture?

Are the various package utilities such as dnf, yum, rpm interoperable? That is, can I use them interchangeably? For example, I usually use dnf. But can I also install some packages with rpm or yum? And would they go into the same package database so that, for example, a query using either dnf, yum, or rpm would show the same results? And would my system 'recognize; all packages regardless of which tools I used to install them?

I see these directories on my system:

/etc/dnf
/etc/yum.repos.d
/etc/rpm

But I only see what looks like a list of repos in the /etc/yum.repos.d directory.

I’ve been meaning to ask this question for a while now, but it resurfaced as I was trying to figure out how to install Signal Messenger on Fedora 42 after I upgraded yesterday.

I just executed this command on my system:

sudo dnf config-manager setopt network_im_signal.enabled=0

It did change the contents of the file /etc/dnf/repos.override.d/99-config_manager.repo from this

# Generated by dnf5 config-manager.
# Do not modify this file manually, use dnf5 config-manager instead.
[network_im_signal]
enabled=1

to this:

# Generated by dnf5 config-manager.
# Do not modify this file manually, use dnf5 config-manager instead.
[network_im_signal]
enabled=0

But the file /etc/yum.repos.d/network:im:signal.repo did not change. It remains thus:

[network_im_signal]
name=Signal Messaging Devel Project (Fedora_41)
type=rpm-md
baseurl=https://download.opensuse.org/repositories/network:/im:/signal/Fedora_41/
gpgcheck=1
gpgkey=https://download.opensuse.org/repositories/network:/im:/signal/Fedora_41/repodata/repomd.xml.key
enabled=1

I found this web page:
https://dnf.readthedocs.io/en/latest/command_ref.html

Quoting the first paragraph:

DNF is the next upcoming major version of YUM, a package manager for RPM-based Linux distributions. It roughly maintains CLI compatibility with YUM and defines a strict API for extensions and plugins.

So I interpret this to mean that dnf is compatible with yum. So I’m perplexed at why the file

/etc/yum.repos.d/network:im:signal.repo 

was not altered when I executed the command:

dnf config-manager setopt network_im_signal.enabled=0

And this page as well seems to imply that dnf and yum are compatible (and interoperable?):

https://docs.fedoraproject.org/en-US/quick-docs/adding-or-removing-software-repositories-in-fedora/

For questions like this, reliable sources such a Wikipedia are much more reliable that the AI clickbait that dominates web searches these days.

The short answer is no, Rpm works with .rpm package files. Dnf is responsible for finding and downloading the packages and then invoking rpm to carry out the specified actions. PackageKit. on rpm-based distros also invokes rpm, but uses a different database. Due to time-delays propagating package updates to the mirror sites, dnf can give different results when used on different systems. PackageKit results can differ from dnf, even on the same system. There is a pkcon command-line tool, but I assume PackageKit is mainly used with Gnome Software, which also supports formats other than .rpm.

No. Yum predates dnf, but is now dnf5, but rpm is normally invoked by dnf.

% ls -l /bin/yum
lrwxrwxrwx. 1 root root 4 Apr 23 21:00 /bin/yum -> dnf5

rpm is sometimes used to install .rpm packages that don’t come from Fedora, but this increases the risks of conflicts and incompatibilities. Some 3rd party packages may not have a Fedora binary .rpm, just a source .rpm that requires building on the local system. If the build fails, you never get a binary .rpm package that can be installed.

2 Likes

Thanks much for this information…

That explains why I see no files under /etc/dnf

I guess I still don’t quite understand. Does dnf uses the rpm database? I don’t see any files under /etc/rpm that would look like a record of installed packages (maybe because I have not used rpm to install anything?).

Or, is it the case that rpm on Fedora is using PackageKit, which has it’s own database? I see /etc/PackageKit but don’t see anything that looks like a package list file. But maybe PackageKit is using a ‘real’ database stored somewhere else on the file system? I perused the Wikipedia PackageKit you referenced, but I did not read in detail and PackageKit documentation yet

I’m just curious for my general understanding of the structure of all these elements. I’m certainly not expecting a tutorial or detailed hand-holding…!

On my Fedora 42 system I see this (so yum is properly linked to dnf5):

$ ls -l `which yum`
lrwxrwxrwx. 1 root root 4 Apr 23 17:00 /usr/bin/yum -> dnf5
$

Thanks for the warning about mixing rpm and dnf package installation. I always use dnf. Mostly I just want to learn one utility well (and who has time to learn multiple ones…?!) but you gave me another justification. I’ll stick with dnf.

Despite what I said about simplifying my lfie and using only one interface such as dnf, I just might explore pkcon. After all, according to the Wikipedia page referenced by @gnwiii it is the official front-end of PackageKit.
:grinning:

Perhaps I’m speaking prematurely… but after looking at the pkcon man page, it seems simpler than even dnf.