How to get DNF to ignore Epochs for selected packages or otherwise give preference to packages in one unofficial repository over those in the official ones?

asked 2017-01-03 07:42:52 -0600

updated 2017-01-03 10:35:38 -0600

I have created by own Open Build Service project 'package' that builds the latest Vim for CentOS 7, Fedora 24/25, Scientific Linux 7, openSUSE 13.2/42.1/42.2/Tumbleweed and the problem with it is that it does not recognize the Epoch: field in my spec file, so even though it is set to Epoch: 2 (like the present Vim packages in the official Fedora repositories) my Vim packages are built with the example file names (if you're wondering and if it's relevant I actually use a 64-bit Fedora 25 system, even though these example packages are for a 32-bit system):


This wouldn't be a problem if it weren't for the fact that DNF, when choosing which packages to install (or upgrade to) factors in Epochs. As because the Vim packages in the official Fedora repositories have the Epoch 2 they are given priority even though their version (presently 8.0.0133) is less than that of my OBS Vim packages (presently 8.0.0142). I have tried adjusting the priority to my home_fusion809 (the name of my OBS repository) repository in my DNF configuration file, namely I've tried increasing it (as the default priority is 99) to 100 and reducing it to 98 or even 1 but none of these efforts have succeeded in getting my OBS builds of Vim to be preferred over those in the official Fedora repositories. If you're curious here is my present /etc/dnf/dnf.conf file (with my priority for home_fusion809 set to 1):



I chose a lower value for home_fusion809's priority as that's what DNF configuration reference said would give preference to the packages in said repository over my other enabled repositories.

edit retag flag offensive close merge delete


Try editing both /etc/yum.repos.d/{fedora,fedora-updatres}.repo , in the [fedora] and [updates] sections respectively add this line: exclude=vim*

this way I think vim can only be installed from your repo. Note that modifying those files will make updates of the fedora-repos package getting installed as e.g. fedora.repo.rpmnew preserving your local changes, so you might want to keep that in mind in case you want to upgrade to a newer release of Fedora in the future.

Ahmad Samir gravatar imageAhmad Samir ( 2017-01-04 06:13:12 -0600 )edit