Bug 884617 - dnf update/distro-sync command line exclude option doesn't work
dnf update/distro-sync command line exclude option doesn't work
Product: Fedora
Classification: Fedora
Component: dnf (Show other bugs)
Unspecified Unspecified
high Severity high
: ---
: ---
Assigned To: Ales Kozumplik
Fedora Extras Quality Assurance
Depends On:
Blocks: 871892
  Show dependency treegraph
Reported: 2012-12-06 07:25 EST by Jan Vcelak
Modified: 2015-10-08 11:19 EDT (History)
5 users (show)

See Also:
Fixed In Version: dnf-0.2.20
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-04-03 10:49:39 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jan Vcelak 2012-12-06 07:25:40 EST
Description of problem:

An option to exclude a packages from update/distro-sync does not work in DNF.

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

How reproducible:

Steps to Reproduce:
1. dnf distro-sync -x tuned
Actual results:

Dependencies Resolved

 Package             Arch   Version               Repository       Size
 tuned               noarch 2.1.0-1.fc18          updates-testing 120 k

Transaction Summary

Expected results:

tuned should not be in the list of updated packages

Additional info:

The same with 'dnf update'. This option is quite useful, if you know that some package in repository is broken and want to use an older version.

The option seems to be implemented, 'yum update -x' gives following error:
Command line error: -x option requires an argument
Comment 1 Ales Kozumplik 2012-12-12 03:12:06 EST
Hi, thanks for the report. The -x option is not supported yet, but it is coming later.
Comment 2 Ales Kozumplik 2012-12-17 03:56:21 EST
Hi Michael,

Can you please advise me about the best way to tackle this with libsolv? In short, yum users are able to specify '-x <name or glob pattern>' with a command that excludes the named packages from the processing, i.e. yum acts as if these packages didn't exist. For instance doing:

yum update -x 'python*'

updates all packages with a higher version available, but not any package whose name starts with 'python'.

I was thinking this could be done by finding all solvables matching the pattern and removing these from their repos with repo_free_solvable(). Is this approach viable?
Comment 3 Ales Kozumplik 2012-12-17 04:14:03 EST
Hm, also just found about about pool->considered. Maybe that's the answer then?
Comment 4 Michael Schröder 2012-12-17 05:43:43 EST
I kinda dislike disabling the packages, as it means they are not available when the solver searches for solutions. Also, you should not remove installed packages.

Maybe it's enough to simply SOLVER_LOCK all the matching packages. That may not be enough for reposync mode, though, but I can make that configurable.
Comment 5 Ales Kozumplik 2012-12-17 06:04:38 EST
Hm, what if I just remove the uninstalled subset of all excludes from pool->considered? That shouldn't harm the solver: it would not see them but that's allright, we  don't want them considered for any operation anyway.

Will look at SOLVER_LOCK too, thanks.
Comment 6 Michael Schröder 2012-12-17 06:12:45 EST
As I said, I don't like that because the solver can't propose good solutions if the packages are removed. I know that dnf currently doesn't propose solutions, but it's something that you may want to do some day.

locking packages is basically the same, it tells the solver that the packages must not change state, i.e. uninstalled packages keep being uninstalled and installed ones keep being installed.
Comment 7 Ales Kozumplik 2013-01-03 09:13:10 EST
Fixed, commit 28a29b4.

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