Bug 1759847

Summary: command `dnf downgrade pkg` emits Error: No packages marked for downgrade
Product: Red Hat Enterprise Linux 8 Reporter: Yongcheng Yang <yoyang>
Component: dnfAssignee: Marek Blaha <mblaha>
Status: CLOSED ERRATA QA Contact: Jan Blazek <jblazek>
Severity: unspecified Docs Contact:
Priority: medium    
Version: 8.0CC: amatej, james.antill, mblaha, xzhou
Target Milestone: rcKeywords: Reproducer, Triaged
Target Release: 8.0Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-4.2.17-4.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-04-28 16:48:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Yongcheng Yang 2019-10-09 09:16:01 UTC
Description of problem:
Just noticed the command `dnf downgrade some_package` now emits error message.
I.e. Error: No packages marked for downgrade

I'm not sure if it's as expected or not.

Version-Release number of selected component (if applicable):
dnf-4.2.7-6.el8.noarch

How reproducible:
always

Steps to Reproduce:
1. dnf downgrade nfs-utils
2.
3.

Actual results:

[root@]# dnf downgrade nfs-utils
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:03:16 ago on Wed 09 Oct 2019 04:58:58 AM EDT.
Package nfs-utils of lowest version already installed, cannot downgrade it.
Error: No packages marked for downgrade.  <<<<<<<<<<<<
[root]# echo $?
1                                         <<<<<<<<<<<<
[root]# dnf upgrade -y nfs-utils
Updating Subscription Management repositories.
Unable to read consumer identity
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Last metadata expiration check: 0:02:49 ago on Wed 09 Oct 2019 04:58:58 AM EDT.
Dependencies resolved.
Nothing to do.
Complete!
[root]# echo $?
0

Expected results:
Return "Nothing to do" but not the error message.

Additional info:
# in the rhel7
[root# rpm -q yum
yum-3.4.3-166.el7.noarch
[root]# yum downgrade rpcbind
Loaded plugins: product-id, search-disabled-repos, subscription-manager

This system is not registered with an entitlement server. You can use subscription-manager to register.

global name 'warnOrGiveUsageMessage' is not defined
Nothing to do
[root]# echo $?
0

Comment 1 Marek Blaha 2019-11-22 07:34:32 UTC
PR https://github.com/rpm-software-management/dnf/pull/1538 unifies exit codes of downgrade and upgrade commands. The behaviour is now also closer to yum3.

Comment 2 Marek Blaha 2019-11-22 08:31:05 UTC
PR with test: https://github.com/rpm-software-management/ci-dnf-stack/pull/700

Comment 5 Vratislav Hutsky 2020-01-08 09:02:10 UTC
Restoring previous qa_ack+ as agreed earlier.

Comment 9 errata-xmlrpc 2020-04-28 16:48:23 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:1823