You can build several binary RPMs out of one source RPM. Given a binary RPM, how can you find the name of the source RPM? This article goes through various methods to find that out.
All sources for packages in Fedora are stored in a so called dist-git.
For example, sources for
cockpit, the web console, are stored under rpm/cockpit.
cockpit source RPM (also referred to as SRPM) is used to build several packages:
cockpit-networkmanager(plugin for Network management)
cockpit-storaged(plugin for managing storage)
and much more.
In the case of the
cockpit-networkmanager package, it’s not hard to guess that it probably comes either from
cockpit-networkmanager source packages.
RPM doesn’t restrict its users to always use the source package name as a prefix though.
A good example is the
httpd (Apache 2 web server) source package.
Of course, the main binary package built out of it is named
Nevertheless, this SRPM is also used to build some popular modules.
These modules are shipped in binary RPMs named
The question is: How to find out that the
mod_ssl RPM was built from the
If you have the package installed, you can just run
rpm -qi [PACKAGE_NAME] to find out, see the following example:
$ rpm -qi mod_ssl Name : mod_ssl ... Signature : RSA/SHA256, Mon Jun 27 12:54:03 2022, Key ID 999f7cbf38ab71f4 Source RPM : httpd-2.4.54-3.fc36.src.rpm Build Date : Fri Jun 17 13:09:36 2022 ...
As you can see, the name that you looked for is under the Source RPM field.
If you don’t have the package installed, you can always use
dnf directly to find out, see:
# dnf info mod_ssl Failed to set locale, defaulting to C.UTF-8 Updating Subscription Management repositories. Last metadata expiration check: 2:21:28 ago on Tue Aug 30 17:00:05 2022. Available Packages Name : mod_ssl ... Size : 111 k Source : httpd-2.4.54-3.fc36.src.rpm Repository : updates ...
The name is shown under the Source field.
Just a quick bonus to end this article.
If you want to inspect the source RPM yourself, you can download it using
dnf download --source:
# dnf download --source mod_ssl ... httpd-2.4.54-3.fc36.src.rpm # file httpd-2.4.54-3.fc36.src.rpm httpd-2.4.54-3.fc36.src.rpm: RPM v3.0 src
rpm -qi <NAME> for installed packages,
dnf info <NAME> doesn’t care if the package is installed.
dnf download --source can be used to download the source package.