Bug 1338975

Summary: PackageKit doesn't obey per-repository "includepkgs" or "exclude" statements
Product: [Fedora] Fedora Reporter: Jonathan Wakely <jwakely>
Component: libdnfAssignee: Jaroslav Rohel <jrohel>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: dmach, jmracek, jonathan, jrohel, klember, mblaha, ncross, pkratoch, rdieter, rhughes, rpm-software-management, sergio, smparrish
Target Milestone: ---Keywords: Reopened, Triaged
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libdnf-0.43.1-1.fc31 libdnf-0.43.1-2.fc30 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-01-25 06:34:45 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 Jonathan Wakely 2016-05-23 19:14:57 UTC
I have a repo with:

[a-repo]
name=repo name
baseurl=http://example.com/repo
enabled=1
# Only use this repo for foo
includepkgs=foo

where the repo contains two packages, foo and libzip-1.1.2-1.fc23.x86_64, which is newer than the libzip in the Fedora repos.

DNF does not try to update libzip, because I said to only include foo from [a-repo], but packagekit ignores the 'includepkgs' and keeps trying to update libzip to the version from [a-repo].

This effectively makes per-repository 'includepkgs' and 'exclude' useless unless I either never use PackageKit, or carefully vet all updates PackageKit does to ensure that 'foo' isn't updated from that repo.

PackageKit should support everything in a .repo file that's documented in yum.conf(5)

Comment 1 Fedora End Of Life 2016-11-25 09:07:14 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 2 Fedora End Of Life 2016-12-20 20:39:54 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Comment 3 Sergio Basto 2017-01-06 00:20:44 UTC

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

Comment 4 Jonathan Wakely 2019-11-28 12:07:07 UTC
Re-opening because Bug 1338975 is about a specific setting in dnf.conf not about package exclusions.

As noted in that other bug, this is a libdnf issue, not PackageKit. libdnf does support "exclude" but not "excludepkgs", and doesn't support wildcards in the exclude config.

This bug can be partially fixed by https://github.com/rpm-software-management/libdnf/pull/856 which adds support for "excludepkgs" in .repo files as well as "exclude", and allows wildcards to be used.

libdnf still doesn't support "includepkgs" but for my current needs, supporting "excludepkgs=*foo*" would be good enough.

Comment 5 Jaroslav Rohel 2019-12-18 10:43:25 UTC
I prepared PR for libdnf https://github.com/rpm-software-management/libdnf/pull/860 .

It improves support for "excludes" in context part of libdnf. With the patch the PackageKit (microdnf, ...) will be respect "excludepkgs", "exclude", "includepkgs" options from repositories configuration files and from global configuration file ("/etc/dnf/dnf.conf"). The patch also adds support for "disable_excludes" option in global configuration file.
The options works similary as in DNF.

I done tests with microdnf and also a simple tests with PackageKit (using pkcon search). It works.
Note: The global configuration file is not automaticaly reloaded after a change. -> If the user modifies "/etc/dnf/dnf.conf", it will be necessary to restart the PackageKit daemon to ensure that the new configuration is used.

Comment 6 Fedora Update System 2020-01-16 21:13:01 UTC
dnf-4.2.18-1.fc30, dnf-plugins-core-4.0.13-1.fc30, libdnf-0.43.1-1.fc30, microdnf-3.4.0-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-66c974fdb6

Comment 7 Fedora Update System 2020-01-16 21:39:40 UTC
dnf-4.2.18-1.fc31, dnf-plugins-core-4.0.13-1.fc31, libdnf-0.43.1-1.fc31, microdnf-3.4.0-1.fc31 has been pushed to the Fedora 31 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-9542e3ccfd

Comment 8 Fedora Update System 2020-01-25 06:34:45 UTC
dnf-4.2.18-1.fc31, dnf-plugins-core-4.0.13-1.fc31, libdnf-0.43.1-1.fc31, microdnf-3.4.0-1.fc31 has been pushed to the Fedora 31 stable repository. If problems still persist, please make note of it in this bug report.

Comment 9 Fedora Update System 2020-02-07 01:03:36 UTC
dnf-4.2.18-1.fc30, dnf-plugins-core-4.0.13-1.fc30, libdnf-0.43.1-2.fc30, microdnf-3.4.0-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-66c974fdb6

Comment 10 Fedora Update System 2020-02-22 01:16:10 UTC
dnf-4.2.18-1.fc30, dnf-plugins-core-4.0.13-1.fc30, libdnf-0.43.1-2.fc30, microdnf-3.4.0-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.