You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dnf history subcommands list and info do not return non-zero exit status when they fail to find transactions for a specified package/<package-name-spec>. This is a bug or undocumented behavior change relative to the corresponding yum history package-list and yum history list (based on this available documentation).
Use Case
Customers may run the aforementioned history commands in their workflows and take specific actions based on if a non-zero exit status is returned or not. If they migrate to start using dnf instead of yum, these workflows may unexpectedly begin taking undesired actions.
For example, a customer may have a workflow that:
runs yum history package-list docker (if yum is being used) or dnf history list docker (if dnf is being used)
if a non-zero exit status is returned, install docker package
otherwise, proceed with an action that makes use of docker package
In the case where dnf is being used, the customer's workflow will proceed to perform an action that makes use of docker package even in the event that no transactions (including install) exist for the docker package. Such action is undesirable for the customer.
Ideally, dnf should match the yum behavior in this case so that customers can reliably detect errors in finding transactions for a given package when running these commands and act accordingly.
Current yum Behavior
Running yum history package-list docker and yum history list docker on an instance with docker not installed returns a non-zero exit status and an error message is written to stderr.
Click here to expand for full output of commands
$ sudo yum history package-list docker 2>&1 1>/dev/null ; echo $?
Bad transaction IDs, or package(s), given
Error: Failed history packages-list
1
$ sudo yum history package-list docker ; echo $?
Loaded plugins: priorities, update-motd
Bad transaction IDs, or package(s), given
Error: Failed history packages-list
1
$ sudo yum history list docker 2>&1 1>/dev/null ; echo $?
No transactions
Error: Failed history list
1
$ sudo yum history list docker ; echo $?
Loaded plugins: priorities, update-motd
No transactions
Error: Failed history list
1
Expected dnf Behavior
Running dnf history list docker and dnf history info docker on an instance with docker not installed returns a non-zero exit status and an error message is written to stderr. This aligns with the current yum behavior.
Observed dnf Behavior
Running dnf history list docker and dnf history info docker on an instance with docker not installed returns an exit status of 0 and no error message is written to stderr.
Click here to expand for full output of commands
$ sudo dnf history list docker 2>&1 1>/dev/null ; echo $?
0
$ sudo dnf history list docker ; echo $?
No transaction which manipulates package 'docker' was found.
0
$ sudo dnf history info docker 2>&1 1>/dev/null ; echo $?
0
$ sudo dnf history info docker ; echo $?
No transaction which manipulates package 'docker' was found.
0
Environment Details
Instance used to run yum commands is an Amazon Linux 2 x86_64 architecture instance with the below version of yum installed:
$ yum --version
3.4.3
Installed: rpm-4.11.3-48.amzn2.0.4.x86_64 at 2025-02-01 06:59
Built : Amazon Linux at 2024-04-17 06:18
Committed: Benjamin Herrenschmidt <[email protected]> at 2024-04-10
Installed: yum-3.4.3-158.amzn2.0.7.noarch at 2025-02-01 06:59
Built : Amazon Linux at 2023-10-18 18:41
Committed: Nic Anderson <[email protected]> at 2023-10-18
Instance used to run dnf commands is an Amazon Linux 2023 x86_64 architecture instance with the below version of dnf installed:
$ dnf --version
4.14.0
Installed: dnf-0:4.14.0-1.amzn2023.0.5.noarch at Mon Feb 3 23:39:06 2025
Built : Amazon Linux at Thu Jun 20 16:37:29 2024
Installed: rpm-0:4.16.1.3-29.amzn2023.0.6.x86_64 at Mon Feb 3 23:38:54 2025
Built : Amazon Linux at Mon Feb 26 20:41:20 2024
The text was updated successfully, but these errors were encountered:
Require one transaction ID for history command actions "list" and "info"
= changelog =
msg: Require one transaction ID for history list + info
type: bugfix
resolves: rpm-software-management#2213
Summary
dnf history
subcommandslist
andinfo
do not return non-zero exit status when they fail to find transactions for a specified package/<package-name-spec>
. This is a bug or undocumented behavior change relative to the correspondingyum history package-list
andyum history list
(based on this available documentation).Use Case
Customers may run the aforementioned history commands in their workflows and take specific actions based on if a non-zero exit status is returned or not. If they migrate to start using
dnf
instead ofyum
, these workflows may unexpectedly begin taking undesired actions.For example, a customer may have a workflow that:
yum history package-list docker
(ifyum
is being used) ordnf history list docker
(ifdnf
is being used)docker
packagedocker
packageIn the case where
dnf
is being used, the customer's workflow will proceed to perform an action that makes use ofdocker
package even in the event that no transactions (including install) exist for thedocker
package. Such action is undesirable for the customer.Ideally,
dnf
should match theyum
behavior in this case so that customers can reliably detect errors in finding transactions for a given package when running these commands and act accordingly.Current
yum
BehaviorRunning
yum history package-list docker
andyum history list docker
on an instance withdocker
not installed returns a non-zero exit status and an error message is written tostderr
.Click here to expand for full output of commands
Expected
dnf
BehaviorRunning
dnf history list docker
anddnf history info docker
on an instance withdocker
not installed returns a non-zero exit status and an error message is written tostderr
. This aligns with the currentyum
behavior.Observed
dnf
BehaviorRunning
dnf history list docker
anddnf history info docker
on an instance withdocker
not installed returns an exit status of 0 and no error message is written tostderr
.Click here to expand for full output of commands
Environment Details
Instance used to run
yum
commands is an Amazon Linux 2 x86_64 architecture instance with the below version ofyum
installed:Instance used to run
dnf
commands is an Amazon Linux 2023 x86_64 architecture instance with the below version ofdnf
installed:The text was updated successfully, but these errors were encountered: