How to block a DNF package update on Fedora

You know the new version of a package is a buggy mess and you don’t want to update, or you manually install an rpm that exists in the repos but you really want to keep the version you installed. There’s an easy way to do that!

Edit (as root) /etc/dnf/dnf.conf and add this line:

exclude = packagename1
exclude = packagename2

Save it. The next time DNF updates, your package won’t be updated! This will work with any distribution that uses DNF (Mageia, future versions of CentOS).

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.