
Selective updates using ‘dnf’
I run Fedora Linux on my home computer. I love that Linux provides a solid yet flexible desktop experience that comes with all kinds of excellent applications and tools. Most importantly, I love that Linux lets me control everything on my computer, so I can run things the way I want to.
While I use the graphical environment for most of my tasks, I still use the command line to do a few things. I run the Xfce desktop, and I usually use the dnfdragora app to update my system. The app provides a graphical interface to install, remove, or update packages. Just run the app, click Select all and then Apply, and the app does the rest.

Oops, I shouldn’t have installed that
However, I recently installed a package to support loading HEIF images, which is the default image format for iPhones. I would not have normally installed that extra HEIF package, except I’m teaching a university course where students sometimes submit photos of things—and a few of my students who use iPhones don’t know how to submit photos in JPEG format.
A few days later, I realized the libheif package caused a weird package conflict with another package that supported H.264 videos. Without getting deep into the details, the third party app I installed required the i686 version of a standard library. Fedora has a standard x86_64 package that conflicts with the other package. Removing either the new package or the standard package causes dnf to try to reinstall a bunch of other packages I don’t want.
It’s a delicate balance, and kind of a hack, but I was able to use the dnf command line program to fix it. At least until the end of the semester, I want to avoid any system updates that include libheif so I don’t accidentally undo my fix.
Excluding packages from updates
The overall format of the dnf command looks like this:
# dnf5 <command> [options] [<args>...]
The dnf command is an alias to dnf5 on the latest Fedora Linux, which I usually run using sudo from my user account. To apply all updates to the system, you might type:
$ sudo dnf update
To apply all updates automatically, you can give the -y
(or --assumeyes
) option like this:
$ sudo dnf update -y
To avoid including a package when you update your system, use the -x
(or --exclude
) option, with a list of packages or other package specification (such as one that uses wildcards) after it. To apply all updates except for any package that matches libheif, type this:
$ sudo dnf update -y -x 'libheif*'
If I need to update the libheif library at some other time, I can simply omit the -x
option. I’ll do that over Spring Break—and look for an alternative way to view HEIF images without using this third party app.