{"id":9797,"date":"2025-03-04T03:00:00","date_gmt":"2025-03-04T08:00:00","guid":{"rendered":"https:\/\/www.both.org\/?p=9797"},"modified":"2025-02-28T16:33:48","modified_gmt":"2025-02-28T21:33:48","slug":"selective-updates-using-dnf","status":"publish","type":"post","link":"https:\/\/www.both.org\/?p=9797","title":{"rendered":"Selective updates using \u2018dnf\u2019"},"content":{"rendered":"<div class=\"pld-like-dislike-wrap pld-template-1\">\r\n    <div class=\"pld-like-wrap  pld-common-wrap\">\r\n    <a href=\"javascript:void(0)\" class=\"pld-like-trigger pld-like-dislike-trigger  \" title=\"\" data-post-id=\"9797\" data-trigger-type=\"like\" data-restriction=\"cookie\" data-already-liked=\"0\">\r\n                        <i class=\"fas fa-thumbs-up\"><\/i>\r\n                <\/a>\r\n    <span class=\"pld-like-count-wrap pld-count-wrap\">    <\/span>\r\n<\/div><\/div>\n<p class=\"wp-block-paragraph\">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.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">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 <strong>dnfdragora<\/strong> app to update my system. The app provides a graphical interface to install, remove, or update packages. Just run the app, click <strong>Select all<\/strong> and then <strong>Apply<\/strong>, and the app does the rest.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1401\" height=\"802\" src=\"https:\/\/www.both.org\/wp-content\/uploads\/2025\/02\/dnfdragora.png\" alt=\"Applying updates with \u2018dnfdragora\u2019\" class=\"wp-image-9798\"\/><figcaption class=\"wp-element-caption\">Applying updates with \u2018dnfdragora\u2019<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"oops-i-shouldnt-have-installed-that\">Oops, I shouldn\u2019t have installed that<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">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\u2019m teaching a university course where students sometimes submit photos of things\u2014and a few of my students who use iPhones don\u2019t know how to submit photos in JPEG format.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A few days later, I realized the <em>libheif<\/em> 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 <em>i686<\/em> version of a standard library. Fedora has a standard <em>x86_64<\/em> package that conflicts with the other package. Removing either the new package or the standard package causes <strong>dnf<\/strong> to try to reinstall a bunch of other packages I don\u2019t want.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s a delicate balance, and kind of a hack, but I was able to use the <strong>dnf<\/strong> command line program to fix it. At least until the end of the semester, I want to avoid any system updates that include <em>libheif<\/em> so I don\u2019t accidentally undo my fix.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"excluding-packages-from-updates\">Excluding packages from updates<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The overall format of the <strong>dnf<\/strong> command looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># dnf5 &lt;command&gt; &#91;options] &#91;&lt;args&gt;...]<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The <strong>dnf<\/strong> command is an alias to <strong>dnf5<\/strong> on the latest Fedora Linux, which I usually run using <strong>sudo<\/strong> from my user account. To apply all updates to the system, you might type:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo dnf update<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To apply all updates automatically, you can give the <code>-y<\/code> (or <code>--assumeyes<\/code>) option like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo dnf update -y<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">To avoid including a package when you update your system, use the <code>-x<\/code> (or <code>--exclude<\/code>) 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 <em>libheif<\/em>, type this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ sudo dnf update -y -x 'libheif*'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If I need to update the <em>libheif<\/em> library at some other time, I can simply omit the <code>-x<\/code> option. I\u2019ll do that over Spring Break\u2014and look for an alternative way to view HEIF images without using this third party app.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here&#8217;s how I update my system except for one problem library<\/p>\n","protected":false},"author":33,"featured_media":3005,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[100,5],"tags":[104,725,91],"class_list":["post-9797","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-command-line","category-linux","tag-command-line","tag-dnf","tag-linux"],"modified_by":"David Both","_links":{"self":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/9797","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/users\/33"}],"replies":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=9797"}],"version-history":[{"count":1,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/9797\/revisions"}],"predecessor-version":[{"id":9799,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/posts\/9797\/revisions\/9799"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=\/wp\/v2\/media\/3005"}],"wp:attachment":[{"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=9797"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=9797"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.both.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=9797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}