dnf reposync implicitly downloads src rpm in RHEL8
Environment
Red Hat Enterprise Linux (RHEL) 7, 8
Issue
In RHEL8, the dnf reposync ... --source command behaves differently from RHEL7 when downloading source packages *.src.rpm.
The *.src.rpm packages are downloaded regardless of the --source option.
Resolution
The observed behavior is not a bug, it is a changed behavior in RHEL8.
If the *.src.rpm packages are not required, they must be explicitly excluded using the --exclude option as the following example:
dnf reposync ... --exclude='*.src'
or
dnf reposync ... -x '*.src'
An example, how to exclude multiple package types:
dnf reposync ... --exclude='*.src,*.nosrc'
See man page:
man dnf | grep -A1 -- '-x '
-x <package-file-spec>, --exclude=<package-file-spec>
Exclude packages specified by <package-file-spec> from the operation.
Diagnostic Steps
Behavior of the dnf reposync ... --source command in the RHEL:
RHEL7
-
if the
--sourceoption is absent only binary RPMs get downloaded -
if the
--sourceoption is present both binary and source RPMs get downloaded
RHEL8
-
if the
--sourceoption is absent both binary and source RPMs get downloaded -
if the
--sourceoption is present only source RPMs get downloaded
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.
Comments