Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1938338 - [rfe] Option to change repository priority from dnf
Summary: [rfe] Option to change repository priority from dnf
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: dnf
Version: 34
Hardware: Unspecified
OS: Unspecified
low
unspecified
Target Milestone: ---
Assignee: rpm-software-management
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: dnf-community
TreeView+ depends on / blocked
 
Reported: 2021-03-12 20:05 UTC by Thiago Sueto
Modified: 2021-03-15 13:24 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Thiago Sueto 2021-03-12 20:05:49 UTC
The current method of changing the priority of repositories is to add an option in dnf.conf.

It would be convenient for dnf to have built-in priority management functionality, similar to what's done in zypper with

zypper modifyrepo --priority <number> <repo>

Setting priorities is particularly useful to define default behavior for updates so there's generally no need for --enablerepo and --disablerepo.

Comment 1 amatej 2021-03-15 13:24:25 UTC
For a temporary override you can use --setopt so for example: dnf install htop --setopt=rawhide.priority=40 (sets priority 40 for the rawhide repository)

But this looks more like you want a permanent modification to the config file, we have a config-manager plugin for that.
It is not the most convenient but you can do: dnf config-manager --setopt=rawhide.priority=40 --save (sets priority 40 for the rawhide repository in the repo file)

Does that work for you?


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