Bug 1061780

Summary: Dnf allows installing conflicting packages
Product: [Fedora] Fedora Reporter: Richard Marko <rmarko>
Component: dnfAssignee: Honza Silhan <jsilhan>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 20CC: akozumpl, jberan, jsilhan, lnie, packaging-team-maint, pmatilai, pnemade, rholy, robatino
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: dnf-plugins-core-0.0.8-2.fc20 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-31 23:58:16 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 Richard Marko 2014-02-05 15:48:23 UTC
Description of problem:
ssia

Version-Release number of selected component (if applicable):
dnf-0.4.12-1.fc20.noarch

How reproducible:
Always

Steps to Reproduce:
0. x86_64
1. dnf install python3 (installs 64bit version)
2. dnf install python3-3.3.2-8.fc20.i686


Actual results:
32bit version installed.

Expected results:
Conflict error.

Additional info:
Same with dnf install /usr/bin/python3

Comment 1 Panu Matilainen 2014-02-06 06:36:03 UTC
Indeed...

[root@localhost ~]# rpm -q python3
python3-3.3.2-8.fc20.x86_64
[root@localhost ~]# rpm -Uvh /tmp/python3-3.3.2-8.fc20.i686.rpm 
Preparing...                          ################################# [100%]
	file /usr/bin/python3.3 from install of python3-3.3.2-8.fc20.i686 conflicts with file from package python3-3.3.2-8.fc20.x86_64
	file /usr/bin/python3.3m from install of python3-3.3.2-8.fc20.i686 conflicts with file from package python3-3.3.2-8.fc20.x86_64

Dnf appears to be enabling a whole lot of rpms problem filters by default, this is just wrong:

        self.rpm_probfilter = [rpm.RPMPROB_FILTER_OLDPACKAGE,
                               rpm.RPMPROB_FILTER_REPLACEPKG,
                               rpm.RPMPROB_FILTER_REPLACEOLDFILES]

rpm.RPMPROB_FILTER_OLDPACKAGE is only needed for downgrade but is not terribly harmful in itself. However REPLACEPKG and REPLACEOLDFILES should never be enabled except for the special case reinstalling a package in-place (eg to repair a damaged package)

Comment 2 Ales Kozumplik 2014-02-06 08:55:15 UTC
Yeah, legit bug. We'll fix this.

Comment 3 Honza Silhan 2014-03-26 15:39:00 UTC
Fixed in the upstream the way as Panu recommends. By default when installing specific package no flag filters are used. For downgrade and dist-sync -> rpm.RPMPROB_FILTER_OLDPACKAGE, for reinstallation and history undo/rollback operations -> rpm.RPMPROB_FILTER_REPLACEPKG and rpm.RPMPROB_FILTER_REPLACEOLDFILES are set.

Comment 4 Honza Silhan 2014-03-26 15:42:05 UTC
* the history commands can have set all of them based on sub-transaction type.

Comment 5 Panu Matilainen 2014-04-02 11:12:30 UTC
Actually... thinking about it a bit more, I dont think rpm.RPMPROB_FILTER_REPLACEOLDFILES should *ever* be set for any of these operations.

The only case it should be needed is when you're reinstalling a package whose contents have changed but NEVR has not. Which is of course NOT an actual reinstall of the same package but something else, and there's a reason rpm requires "nasty" switches (--force basically) for this operation.

Now there might of course be some other case I'm forgotting, but given how nasty rpm.RPMPROB_FILTER_REPLACEOLDFILES is, I'd suggest erring on the side of caution and simply dropping that one completely now, and reconsider if the need actually rises.

Comment 6 Fedora Update System 2014-05-02 08:31:56 UTC
dnf-0.5.1-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/dnf-0.5.1-1.fc20

Comment 7 Honza Silhan 2014-05-02 13:25:31 UTC
FYI rpm.RPMPROB_FILTER_REPLACEOLDFILES flag is removed in dnf-5.0.2.

Comment 8 Fedora Update System 2014-05-02 21:04:27 UTC
Package dnf-0.5.1-1.fc20, hawkey-0.4.14-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing dnf-0.5.1-1.fc20 hawkey-0.4.14-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-5937/hawkey-0.4.14-1.fc20,dnf-0.5.1-1.fc20
then log in and leave karma (feedback).

Comment 9 lnie 2014-05-20 06:43:35 UTC
Tested with dnf-0.5.1-1.fc20 and hawkey-0.4.14-1.fc20,the bug is gone

Comment 10 Fedora Update System 2014-05-28 12:09:46 UTC
dnf-plugins-core-0.0.8-2.fc20, libsolv-0.6.1-1.git6d968f1.fc20, hawkey-0.4.16-1.fc20, dnf-0.5.2-1.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/libsolv-0.6.1-1.git6d968f1.fc20,hawkey-0.4.16-1.fc20,dnf-0.5.2-1.fc20,dnf-plugins-core-0.0.8-2.fc20

Comment 11 Fedora Update System 2014-05-28 23:49:44 UTC
Package dnf-plugins-core-0.0.8-2.fc20, libsolv-0.6.1-1.git6d968f1.fc20, hawkey-0.4.16-1.fc20, dnf-0.5.2-1.fc20:
* should fix your issue,
* was pushed to the Fedora 20 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.0.8-2.fc20 libsolv-0.6.1-1.git6d968f1.fc20 hawkey-0.4.16-1.fc20 dnf-0.5.2-1.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2014-6789/libsolv-0.6.1-1.git6d968f1.fc20,hawkey-0.4.16-1.fc20,dnf-0.5.2-1.fc20,dnf-plugins-core-0.0.8-2.fc20
then log in and leave karma (feedback).

Comment 12 Fedora Update System 2014-05-31 23:58:16 UTC
dnf-plugins-core-0.0.8-2.fc20, libsolv-0.6.1-1.git6d968f1.fc20, hawkey-0.4.16-1.fc20, dnf-0.5.2-1.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.