Bug 1243501

Summary: `dnf downgrade' treats installed packages as not installed
Product: [Fedora] Fedora Reporter: Matus Honek <mhonek>
Component: dnfAssignee: Adam Salih <asalih>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: bob53181, jsilhan, jzeleny, mluscon, pnemade, rholy, tim.lauridsen, vmukhame
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: dnf-plugins-core-0.1.10-1.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-08-15 02:13:39 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 Matus Honek 2015-07-15 15:22:22 UTC
Description of problem:
When downgrading packages using `dnf downgrade <package-name>\*', dnf incorrectly considers already installed packages (aka those eligible for downgrading) as if they were not installed, resulting in `No match for available package' also for already installed packages, which is IMO incorrect.

Version-Release number of selected component (if applicable):
Latest Fedora Rawhide.

How reproducible:
Always.

Steps to Reproduce:
1. Upgrade packages to higher version than the one available in repos.
2. Try to downgrade using `dnf downgrade <package-name>\*'.

Actual results:
For `openldap' package behaves as follows:

[root@vm-086 10353731]# dnf downgrade openldap\*
Last metadata expiration check performed 1:58:03 ago on Wed Jul 15 14:57:43 2015.
No match for available package: openldap-2.4.40-14.fc23.i686
No match for available package: openldap-2.4.40-14.fc23.x86_64
No match for available package: openldap-clients-2.4.40-14.fc23.x86_64
No match for available package: openldap-devel-2.4.40-14.fc23.i686
No match for available package: openldap-devel-2.4.40-14.fc23.x86_64
No match for available package: openldap-servers-2.4.40-14.fc23.x86_64
Error: Nothing to do.

[root@vm-086 10353731]# dnf list openldap\*
Last metadata expiration check performed 1:59:16 ago on Wed Jul 15 14:57:43 2015.
Installed Packages
openldap.x86_64                                 2.4.41-1.fc23                           @System
openldap-clients.x86_64                         2.4.41-1.fc23                           @System
openldap-devel.x86_64                           2.4.41-1.fc23                           @System
openldap-servers.x86_64                         2.4.41-1.fc23                           @System
Available Packages
openldap.i686                                   2.4.40-14.fc23                          rawhide
openldap-devel.i686                             2.4.40-14.fc23                          rawhide


Expected results:
Apart from resolving #1234763, dnf should also correctly match already installed packages and display correct statements instead of `No match for available package' for these.

Additional info:
  - Yum handles this as expected.
  - Beforehand I upgraded packages to version 2.4.41-1 (available as a scratch-build in koji) using `yum update openldap*.rpm'.

Comment 1 Honza Silhan 2015-07-15 15:28:57 UTC
Thanks for the report. Adam, take a lok, please - you have done this for update command.

Comment 2 Honza Silhan 2015-07-29 14:38:24 UTC
PR: https://github.com/rpm-software-management/dnf/pull/306

Comment 3 Fedora Update System 2015-08-10 10:05:53 UTC
dnf-plugins-core-0.1.10-1.fc23,dnf-1.1.0-1.fc23,hawkey-0.6.0-1.fc23 has been submitted as an update for Fedora 23.
https://admin.fedoraproject.org/updates/dnf-plugins-core-0.1.10-1.fc23,dnf-1.1.0-1.fc23,hawkey-0.6.0-1.fc23

Comment 4 Fedora Update System 2015-08-10 10:49:55 UTC
dnf-plugins-core-0.1.10-1.fc22,dnf-1.1.0-1.fc22,hawkey-0.6.0-1.fc22 has been submitted as an update for Fedora 22.
https://admin.fedoraproject.org/updates/dnf-plugins-core-0.1.10-1.fc22,dnf-1.1.0-1.fc22,hawkey-0.6.0-1.fc22

Comment 5 Fedora Update System 2015-08-11 02:11:07 UTC
Package dnf-plugins-core-0.1.10-1.fc22, dnf-1.1.0-1.fc22, hawkey-0.6.0-1.fc22:
* should fix your issue,
* was pushed to the Fedora 22 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnf-plugins-core-0.1.10-1.fc22 dnf-1.1.0-1.fc22 hawkey-0.6.0-1.fc22'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2015-13162/dnf-plugins-core-0.1.10-1.fc22,dnf-1.1.0-1.fc22,hawkey-0.6.0-1.fc22
then log in and leave karma (feedback).

Comment 6 Fedora Update System 2015-08-15 02:13:39 UTC
dnf-plugins-core-0.1.10-1.fc22, hawkey-0.6.0-1.fc22, dnf-1.1.0-2.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Fedora Update System 2015-08-19 07:51:40 UTC
dnf-plugins-core-0.1.10-1.fc23, hawkey-0.6.0-1.fc23, dnf-1.1.0-2.fc23 has been pushed to the Fedora 23 stable repository.  If problems still persist, please make note of it in this bug report.