Red Hat Bugzilla – Bug 884617
dnf update/distro-sync command line exclude option doesn't work
Last modified: 2015-10-08 11:19:26 EDT
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):
Steps to Reproduce:
1. dnf distro-sync -x tuned
Package Arch Version Repository Size
tuned noarch 2.1.0-1.fc18 updates-testing 120 k
tuned should not be in the list of updated packages
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
Hi, thanks for the report. The -x option is not supported yet, but it is coming later.
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?
Hm, also just found about about pool->considered. Maybe that's the answer then?
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.
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.
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.
Fixed, commit 28a29b4.