Bug 1304887 - dnf always installs newest version, ignoring excludes
Summary: dnf always installs newest version, ignoring excludes
Keywords:
Status: CLOSED DUPLICATE of bug 1279185
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 23
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-02-04 22:04 UTC by Jef Oliver
Modified: 2016-02-15 14:30 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-02-15 14:30:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
repo files for DNF (785 bytes, application/x-gzip)
2016-02-09 04:24 UTC, Jef Oliver
no flags Details

Description Jef Oliver 2016-02-04 22:04:56 UTC
Description of problem:
When installing a package, or when a package is installed as a dependency, dnf always installs the latest available version, ignoring excludes. This was found using the installroot option.

Example:
A kernel repository is added to Fedora containing kernel packages. The repository sections for [fedora] and [fedora-updates] have exclude=kernel* added to them. The kernel is available in the separate repository. Despite the exclude lines being in place and the kernel being available in the second repo, dnf sees that upstream has a newer kernel version and uses it.

This example works fine using yum on Fedora 21.


Version-Release number of selected component (if applicable):
dnf 1.1.6

How reproducible:
Every time

Steps to Reproduce:
1. Create a new repository with a package that is older than upstream availability.
2. Create an installroot location, ie a chroot install. (rpm --initdb /some/path/db, dfn --installroot install fedora-release fedora-repo)
3. Add new repository to installroot
4. dnf --installroot=/some/path install package_in_new_repo

Actual results:
The newer, upstream, excluded package is used.

Expected results:
The newer, upstream, excluded package should be ignored, and the older package in the unexcluded repo should be installed.

Comment 1 Jaroslav Mracek 2016-02-08 13:01:51 UTC
Please could you provide some additional information. Could you send us both dnf.conf file from host and --installroot with exact marked locations where each file was located.

Comment 2 Jef Oliver 2016-02-09 04:24:28 UTC
Created attachment 1122338 [details]
repo files for DNF

dnf.conf files are unmodified. I only copy repo files into place.

I create a new root directory.
/tmp/XN0TDJIB3MBGLD9L/image/root

Download fedora-release and fedora-repos rpms and install

rpm --quiet --root /tmp/XN0TDJIB3MBGLD9L/image/root --initdb
rpm --quiet --root /tmp/XN0TDJIB3MBGLD9L/image/root -i --nodeps /tmp/XN0TDJIB3MBGLD9L/download/onpss-internal-0.0.2-201602081749.gitdb76a315.fc21.x86_64.rpm /tmp/XN0TDJIB3MBGLD9L/download/fedora-repos-23-1.noarch.rpm /tmp/XN0TDJIB3MBGLD9L
/download/fedora-release-23-1.noarch.rpm

After this, I copy the files in the attachment to /tmp/XN0TDJIB3MBGLD9L/image/root/etc/yum.repos.d/

Then install packages
dnf -q -y --installroot=/tmp/XN0TDJIB3MBGLD9L/image/root --enablerepo=*-daily makecache
dnf -q -y --installroot=/tmp/XN0TDJIB3MBGLD9L/image/root --enablerepo=*-daily install yum yum-utils kernel systemd iproute

If the kernel that is located in my addon kernel repo is older than upstream, dnf seems to ignore my provided kernel and force uses the upstream version. This was not the case using standard yum in Fedora 21.

Comment 3 Jaroslav Mracek 2016-02-15 12:57:41 UTC
I am going to test your case.

Comment 4 Jaroslav Mracek 2016-02-15 14:30:09 UTC
Ok I think I have it. The repository are taken from host at the present version of DNF. Your problem will be solved by new version of dnf, where behavior is changed. See pull-request https://github.com/rpm-software-management/dnf/pull/428.
There is also new detailed description in documentation. 
 Thanks for reporting.

*** This bug has been marked as a duplicate of bug 1279185 ***


Note You need to log in before you can comment on or make changes to this bug.