{"id":2602,"date":"2022-09-11T12:56:56","date_gmt":"2022-09-11T04:56:56","guid":{"rendered":"https:\/\/guerilla.ddns.net\/wp\/?p=2602"},"modified":"2025-08-24T05:30:23","modified_gmt":"2025-08-23T21:30:23","slug":"update-fedora-linux-to-get-latest-software","status":"publish","type":"post","link":"https:\/\/guerilla.ddns.net\/wp\/?p=2602","title":{"rendered":"Update Fedora Linux to Get Latest Software"},"content":{"rendered":"<p>This is the recommended command-line upgrade method.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">&lt;pre&gt;dnf check-update<\/code><\/pre>\n<pre><code class=\"language-bash\" data-line=\"\">sudo dnf upgrade<\/code><\/pre>\n<p>or<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sudo dnf upgrade --refresh<\/code><\/pre>\n<p>&nbsp;<\/p>\n<h2>About dnf <font color=red>upgrade<\/font><\/h2>\n<p>Aliases: <font color=red>up<\/font><br \/>\nDeprecated aliases: <font color=red>update<\/font>, <font color=red>upgrade-to<\/font>, <font color=red>update-to<\/font>, <font color=red>localupdate<\/font><br \/>\n&nbsp;<\/p>\n<h2>Clean-up packages<\/h2>\n<p>You can safely remove packages no longer in use with:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sudo dnf autoremove<\/code><\/pre>\n<p>&nbsp;<br \/>\nYou can see duplicate packages (packages with multiple versions installed) with:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sudo dnf repoquery --duplicates<\/code><\/pre>\n<p>&nbsp;<br \/>\nSome packages that are still on your system may no longer be in the repositories. To see a list of these packages do:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sudo dnf list extras<\/code><\/pre>\n<p>&nbsp;<br \/>\nIf you see a package you do not need, or use, you can remove it with:<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sudo dnf remove package<\/code><\/pre>\n<p>&nbsp;<br \/>\nOld kernels remain even after <font color=red>dnf autoremove<\/font>.<br \/>\n&nbsp;<br \/>\nThe script below works whenever Fedora updates a kernel, and does not depend upon a system upgrade.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">#!\/usr\/bin\/env bash\n\nold_kernels=($(dnf repoquery --installonly --latest-limit=-1 -q))\nif [ &quot;${#old_kernels[@]}&quot; -eq 0 ]; then\n    echo &quot;No old kernels found&quot;\n    exit 0\nfi\n\nif ! dnf remove &quot;${old_kernels[@]}&quot;; then\n    echo &quot;Failed to remove old kernels&quot;\n    exit 1\nfi\n\necho &quot;Removed old kernels&quot;\nexit 0<\/code><\/pre>\n<h2>Clean-up old symlinks<\/h2>\n<p>There may be some dangling symlinks in the filesystem after an upgrade. You can clean the dangling links by installing the symlinks utility and deleteing the old links.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sudo dnf install symlinks<\/code><\/pre>\n<p>&nbsp;<br \/>\nOnce the utility is installed you can audit for broken symlinks like shown below. -r means recursive.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sudo symlinks -r \/usr | grep dangling<\/code><\/pre>\n<p>&nbsp;<br \/>\nAfter you verify the list of broken symlinks you can delete them like shown below. -d means delete.<\/p>\n<pre><code class=\"language-bash\" data-line=\"\">sudo symlinks -r -d \/usr<\/code><\/pre>\n<p>&nbsp;<br \/>\n&nbsp;<br \/>\nref:<br \/>\n\u2022 <a href=\"https:\/\/docs.fedoraproject.org\/en-US\/quick-docs\/dnf-system-upgrade\/\" rel=\"noopener\" target=\"_blank\"><em>DNF System Upgrade<\/em><\/a><br \/>\n\u2022 <a href=\"https:\/\/dnf.readthedocs.io\/en\/latest\/command_ref.html#upgrade-command-label\" rel=\"noopener\" target=\"_blank\"><em>DNF Command Reference<\/em><\/a><br \/>\n&nbsp;<br \/>\n#fedora36<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the recommended command-line upgrade method. &#038;l [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[179],"tags":[193],"class_list":["post-2602","post","type-post","status-publish","format-standard","hentry","category-infotech","tag-fedora"],"_links":{"self":[{"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2602","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2602"}],"version-history":[{"count":10,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2602\/revisions"}],"predecessor-version":[{"id":3443,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=\/wp\/v2\/posts\/2602\/revisions\/3443"}],"wp:attachment":[{"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2602"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2602"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/guerilla.ddns.net\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2602"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}