Bug 1256108 - libhif doesn't honor dnf.conf (or yum.conf)
libhif doesn't honor dnf.conf (or yum.conf)
Status: NEW
Product: Fedora
Classification: Fedora
Component: PackageKit (Show other bugs)
rawhide
Unspecified Unspecified
urgent Severity urgent
: ---
: ---
Assigned To: Richard Hughes
Fedora Extras Quality Assurance
: FutureFeature
: 1237014 1280590 1288587 1307217 1328677 1338975 1349518 1425925 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-08-23 21:22 EDT by Sergio Monteiro Basto
Modified: 2018-02-26 20:15 EST (History)
26 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Sergio Monteiro Basto 2015-08-23 21:22:38 EDT
Description of problem:
I have set installonly_limit=4 in /etc/yum.conf and /etc/dnf/dnf.conf, and now packagitkit always ask for deletion the last kernel , I think that use defaults 
installonly_limit=3 ...



Version-Release number of selected component (if applicable):
libhif-0.2.0-3.fc21.x86_64
PackageKit-1.0.6-1.fc21.x86_64


How reproducible:
Wait for updates


Actual results:
Ago 24 01:16:54 segulix PackageKit[24510]: new update-packages transaction /40777_ddddcbcc scheduled from uid 500
Ago 24 01:16:56 segulix PackageKit[24510]: in /40777_ddddcbcc for update-packages package kernel;4.0.8-200.fc21;x86_64;installed:/kernel-4.0.8-200.fc21.x86_64 was removing for uid 500
Ago 24 01:16:56 segulix PackageKit[24510]: in /40777_ddddcbcc for update-packages package kernel-core;4.0.8-200.fc21;x86_64;installed:/kernel-core-4.0.8-200.fc21.x86_64 was removing for uid 500
Ago 24 01:16:56 segulix PackageKit[24510]: in /40777_ddddcbcc for update-packages package kernel-modules;4.0.8-200.fc21;x86_64;installed:/kernel-modules-4.0.8-200.fc21.x86_64 was removing for uid 500
Ago 24 01:16:56 segulix PackageKit[24510]: in /40777_ddddcbcc for update-packages package gnome-software;3.14.7-1.fc21;x86_64;updates was updating for uid 500
Ago 24 01:16:56 segulix PackageKit[24510]: update-packages transaction /40777_ddddcbcc from uid 500 finished with success after 1316ms
Comment 1 Sergio Monteiro Basto 2015-09-12 17:37:54 EDT
Since the only backend available is default , this is packagekit problem . 


We got 2 questions in ask , one really question and one issue : 

https://ask.fedoraproject.org/en/question/64436/is-it-possible-to-use-yum-backend-for-packagekit-on-fedora-21/


https://ask.fedoraproject.org/en/question/75195/installonly_limit5-but-only-3-kernels-being-saved/?answer=75299#post-id-75299


Please replay something 
Thanks
Comment 2 Richard Hughes 2015-09-14 06:45:49 EDT
Why would libhif read dnf.conf? PackageKit doesn't use dnf, it only shares libraries used by dnf so it would be a bit peculiar to share a config file...
Comment 3 Fedora End Of Life 2015-11-04 05:30:30 EST
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. 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 '21'.

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 21 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 4 Sergio Monteiro Basto 2015-11-04 09:55:10 EST
In future will be nice, libhif follow one custom configuration .
Comment 5 Sergio Monteiro Basto 2015-11-07 09:10:17 EST
Also we can't make apper exclude packages .
Comment 6 Rex Dieter 2015-11-30 10:51:07 EST
*** Bug 1237014 has been marked as a duplicate of this bug. ***
Comment 7 Rex Dieter 2015-11-30 10:51:50 EST
*** Bug 1280590 has been marked as a duplicate of this bug. ***
Comment 8 Rex Dieter 2015-12-08 09:34:19 EST
*** Bug 1288587 has been marked as a duplicate of this bug. ***
Comment 9 Rex Dieter 2016-02-13 08:05:00 EST
Re comment #5

PackageKit (and dnf) will honor 
exclude=
directives added to .repo files under /etc/yum.repos.d/ (for any/all repos you want to be skipped and excluded)
Comment 10 Rex Dieter 2016-02-13 08:05:11 EST
*** Bug 1307217 has been marked as a duplicate of this bug. ***
Comment 11 Sergio Monteiro Basto 2016-02-13 10:59:04 EST
(In reply to Rex Dieter from comment #9)
> Re comment #5
> 
> PackageKit (and dnf) will honor 
> exclude=
> directives added to .repo files under /etc/yum.repos.d/ (for any/all repos
> you want to be skipped and excluded)

I'm testing /etc/yum.repos.d/fedora.repo with:

[fedora]
name=Fedora $releasever - $basearch
failovermethod=priority
#baseurl=http://download.fedoraproject.org/pub/fedora/linux/releases/$releasever/Everything/$basearch/os/
metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
enabled=1
metadata_expire=28d
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-$releasever-$basearch
skip_if_unavailable=False
installonly_limit=4

but shouldn't libhif have one file the define the defaults  ? for example /etc/libhif.conf
Comment 12 Eric Lavarde 2016-02-15 02:26:05 EST
As an admin user, I don't want to have two configuration files for the same topic, but I want to have package management acting the same on the command line and in whichever GUI.

(in 1307217, I complained that the versionlock plugin wasn't taken into account)

This accepted as a valid user story, the question "Is it possible to use yum backend for PackageKit on Fedora 21?" can be rewritten to "Is it possible to use dnf backend for PackageKit on Fedora 22+?"
Comment 13 Sergio Monteiro Basto 2016-03-12 09:48:59 EST
(In reply to Sergio Monteiro Basto from comment #11)

> installonly_limit=4

doesn't work PackageKit removed my 4th kernel
Comment 14 Rex Dieter 2016-03-12 09:54:57 EST
Re: comment 12

currently, no

My own prior comments about moving directives to .repo files were only about include/exclude statements.  You all are right, that some directives are dnf-only.
Comment 15 Rex Dieter 2016-04-19 23:50:34 EDT
*** Bug 1328677 has been marked as a duplicate of this bug. ***
Comment 16 Sergio Monteiro Basto 2017-01-05 19:20:44 EST
*** Bug 1338975 has been marked as a duplicate of this bug. ***
Comment 17 Jonathan Wakely 2017-01-06 05:20:58 EST
Repeated from the Bug 1338975 duplicate, which is not about dnf.conf but about the .repo files, which definitely are used by PK...

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 18 Sergio Monteiro Basto 2017-01-08 16:14:38 EST
https://bugzilla.redhat.com/show_bug.cgi?id=1350732

include exclude=foo in section of /etc/yum.repos.d/fedora.repo make crash packagekitd

please someone do something .
Comment 19 Rex Dieter 2017-02-22 17:26:31 EST
*** Bug 1425925 has been marked as a duplicate of this bug. ***
Comment 20 Nick Cross 2017-05-03 05:14:47 EDT
I have noticed this running apper under Fedora 25 ; its very unexpected behaviour that the command line differs from the GUI and there is no (apparent) way of configuring the GUI to behave the same.
Comment 21 Nick Cross 2017-05-10 09:26:24 EDT
Further I want to exclude certain packages from update and even using the workaround of adding exclude to yum.conf, while it works on the CLI, it fails with the apper GUI. Tested on Fedora 25. Further wildcards don't work with packagekit (but they do with CLI) so individual packages have to be listed manually.
Comment 22 Rex Dieter 2017-05-10 09:53:20 EDT
Re: comment 21

For package exclusion, see comment #9 , that packagekit does honor include/exclude in individual .repo files
Comment 23 Sergio Monteiro Basto 2017-08-04 06:28:53 EDT
2 years later , this does not work ! , should we remove it from the system ?
Comment 24 Samuel Sieb 2017-09-04 13:46:36 EDT
I tried adding the exclude to the repo file and packagekit still says it will update it.  I have to tell the users not to do any updates or their laptops will stop working...
Comment 25 Rex Dieter 2017-10-12 09:55:18 EDT
I can confirm exclude= (still) works for me on my f26 box.  My test was adding
exclude=firefox
to /etc/yum.repos.d/fedora-updates-testing.repo
and indeed a firefox update in -testing disappears after I do a 'pkcon refresh'
Comment 26 Sergio Monteiro Basto 2017-10-16 06:59:04 EDT
*** Bug 1349518 has been marked as a duplicate of this bug. ***
Comment 27 Nick Cross 2017-10-19 05:25:02 EDT
Further I have noticed, as mentioned in Bug 1338975 and in a comment above. If I add

includepkgs=xxxx*

to a particular repository file, while the command line"dnf update" correctly notices and applies that, the apper gui (using PackageKit underneath) does _not_ use this configuration directive and attempts to use other packages from the aforementioned repository. The GUI should be consistent with the CLI to provide a quality user experience.

I am using Fedora 26.

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