Close Menu
Linux All DayLinux All Day
    Facebook Bluesky Mastodon X (Twitter)
    Linux All DayLinux All Day
    • News
    • Operating Systems
      • Linux Distributions
      • Android-based OS
      • ChromeOS Alternatives
    • Software
      • Apps & Tools
      • Desktop Environments
      • Installation & Management
    • Tutorials
      • Linux Basic & Tips
      • System Optimization
      • Security & Privacy
    • Linux Gaming
      • Game News & Reviews
      • Emulators & Retro
      • Performance & Benchmarks
    • Comparisons
    Mastodon Bluesky Facebook
    Linux All DayLinux All Day
    Home - Software - Installation & Management - How to Use DNF Package Manager: The Ultimate 2025 Guide (DNF5)

    How to Use DNF Package Manager: The Ultimate 2025 Guide (DNF5)

    By Mitja Installation & Management October 24, 20257 Mins Read
    Share Facebook Bluesky Twitter Threads Reddit LinkedIn Telegram Tumblr Email Copy Link Pinterest
    Follow Us
    Facebook Mastodon Bluesky X (Twitter)
    A guide on how to use DNF package manager, showing the DNF5 logo on a Fedora terminal screen.
    Share
    Facebook Twitter Bluesky Reddit Threads Tumblr Email Copy Link

    If you’re using a modern Red Hat-based system like Fedora 43, CentOS Stream, or RHEL, you will inevitably interact with DNF. While the Software Center (GUI) is great for browsing, the terminal is where the real power lies. Understanding how to use DNF package manager is the single most important skill for managing your system effectively.

    DNF, which stands for “Dandified YUM,” is the modern, robust package manager that handles installing, updating, and removing software on your Linux system.

    This guide is designed to make you comfortable and confident with the latest commands. We’ll start with the absolute basics and move on to some powerful tricks that will make you feel like a pro.

    You Are Using DNF5: What You Need to Know

    If you are using Fedora 41 or newer (including our current Fedora 43), you are using DNF5 by default. This is important to know.

    • The YUM -> DNF4 -> DNF5 History: DNF (also known as DNF4) replaced the older YUM years ago. Now, DNF5 has superseded DNF4, bringing massive improvements in speed and management.
    • The Command is the Same: On your system, the dnf command is now simply a symbolic link (symlink) to dnf5. So, when you type dnf, you are actually running DNF5.
    • Command Compatibility: The good news is that all the basic commands you know (like install, remove, search) are identical. Only a few advanced commands have changed, which we will highlight in this guide.
    • Critical Warning: DNF4 and DNF5 do not share transaction histories. If you just upgraded from an older system, DNF5 will not see the DNF4 history. For clean installs of Fedora 43, this is not an issue.

    The Basic DNF Command Syntax

    The first thing to know is that almost every DNF command that makes changes to your system requires administrative privileges. This means you must preface your commands with sudo.

    The basic syntax looks like this:

    sudo dnf [options] [command] [package_name]
    

    This structure will become second nature very quickly. Let’s break down the most useful commands.

    How to Manage Packages with DNF: The Daily Essentials

    This section covers the commands you will use 90% of the time. This is the core of how to manage packages with DNF.

    1. Updating Your System

    This is the most crucial task you should perform regularly. Keeping your system updated patches security vulnerabilities and provides you with the latest features.

    First, you can check what updates are available:

    sudo dnf check-update
    

    This command is safe and will only list the packages that have a new version available.

    To actually download and apply the updates, run the upgrade command. It’s good practice to add the --refresh flag to ensure DNF fetches the latest list of packages from the repositories first.

    sudo dnf upgrade --refresh
    

    DNF will show you a list of everything it’s about to do and ask for confirmation. Just press y and Enter to proceed.

    2. Searching for a Package

    You want to install a program, but you’re not sure of its exact name. The search command is your best friend.

    dnf search [keyword]
    

    For example, if you’re looking for the GIMP image editor:

    dnf search gimp
    

    DNF will search its database and return a list of packages that match your keyword in their name or description. You’ll see something like gimp.x86_64, which tells you the exact package name you need.

    3. Getting Information About a Package

    Before you install something, you might want to know more about it. The info command provides a detailed description, version, release, and which repository it comes from.

    dnf info [package_name]
    

    Using our GIMP example:

    dnf info gimp
    

    This is perfect for verifying you have the right package.

    4. Installing a Package

    Once you know the package name, installing it is simple:

    sudo dnf install [package_name]
    

    Let’s install GIMP:

    sudo dnf install gimp
    

    DNF will automatically calculate all the dependencies (other packages that GIMP needs to run) and ask for your permission to install them all.

    If you are 100% sure you want to proceed and want to skip the [y/N] prompt, you can add the -y flag:

    sudo dnf install gimp -y
    

    5. Removing a Package

    If you no longer need a program, you can remove it just as easily:

    sudo dnf remove [package_name]
    

    To remove GIMP:

    sudo dnf remove gimp
    

    DNF will show you the package(s) it’s about to remove and ask for confirmation.


    Warning: Removing Packages and Dependencies

    When you run sudo dnf remove [package], DNF removes that specific package. However, it might leave behind dependencies that were installed only for that package and are now no longer needed. To clean these up, you should run the autoremove command.

    6. Cleaning Up Orphaned Dependencies

    This is the command you should run after removing software to keep your system clean. autoremove finds and removes packages that were installed as dependencies but are no longer required by any installed program.

    sudo dnf autoremove
    

    This is a safe and highly recommended command to run periodically.

    Advanced DNF Command Examples

    Ready to level up? These dnf command examples solve common problems and showcase DNF5’s true power.

    7. Finding Which Package Provides a File

    Have you ever seen an error message about a missing file (like libsomething.so.2)? Or wondered which package installed a specific command (like /usr/bin/ssh)? The provides command is your solution.

    dnf provides [path/to/file]
    

    Example:

    dnf provides /usr/bin/htop
    

    DNF will search the repositories and tell you, “htop-3.3.0-1.fc43.x86_64 : Interactive process viewer,” so you know the htop package is what you need to install.

    8. Managing Package Groups

    Sometimes, you want to install a whole set of tools for a specific purpose, like “Development Tools” or a full desktop environment like “KDE Plasma Workspaces.” DNF uses “groups” for this.

    First, you can list all available groups:

    dnf group list
    

    DNF5 Change: The command to install a group is now group install (two words).

    sudo dnf group install "Development Tools"
    

    (Note: Use quotes if the group name has spaces.)

    Similarly, the command to remove a group is group remove:

    sudo dnf group remove "Development Tools"
    

    9. Viewing DNF History

    This is one of DNF’s best features. DNF logs every single transaction (install, remove, upgrade) you perform.

    DNF5 Change: To see the log, you must now run history list:

    dnf history list
    

    You will see a list with an ID number for each transaction. This is more than just a log; it’s an “undo” button.

    10. The Ultimate “Undo”: Rolling Back Transactions

    Did that last update break something? Did you accidentally remove a package you needed? You can use the history log to reverse a transaction.

    First, run dnf history list to find the ID of the transaction you want to undo. Let’s say it was ID 42.

    To roll back that action, you run (this command remains the same):

    sudo dnf history undo 42
    

    DNF will calculate what’s needed to revert your system to the state it was in before transaction #42 occurred. This is an absolute lifesaver.

    DNF vs. Flatpak: A Quick Note

    As a modern Fedora user, you’ll see both DNF and Flatpak. It’s important to know the difference.

    • DNF manages system-level packages (RPMs) from the official FEDORA PROJECT repositories. These are integrated deeply into your OS.
    • Flatpak manages sandboxed, containerized applications that run in isolation from your main system. These often come from FLATHUB and are great for desktop apps.

    You will use both! Use DNF for system libraries, command-line tools, and core components. Use Flatpak for desktop applications like Spotify, Slack, or Steam.

    Conclusion: You Are Now in Control

    You’ve just learned how to use DNF package manager (specifically DNF5). You know how to find, install, update, and remove software. More importantly, you know how to clean up your system with autoremove, find files with provides, and even travel back in time with dnf history undo.

    DNF5 is a powerful, reliable tool, and by mastering these commands, you have taken a massive step toward becoming a confident Linux power user.

    What are your favorite DNF commands or tips? Did the history undo command ever save you from a major headache? Share your experiences and questions in the comments below!

    Follow on Mastodon Follow on Bluesky
    Share. Facebook Twitter Bluesky Reddit Threads Telegram Email Copy Link

    Related post

    How to Install Apps on Linux (2025): The Ultimate Guide for Fedora, Debian, & Arch

    November 26, 2025

    How to Setup Flathub on Linux: A 2025 Guide (Fedora, Debian, Arch, openSUSE)

    November 12, 2025

    What is a Linux App Center? The Snap Store Explained (2025)

    November 4, 2025
    Leave A Reply Cancel Reply

    → Switch to Linux Today
    • Facebook
    • Twitter
    • Mastodon
    • Bluesky
    More From Linuxallday
    Beyond the Grid: Mastering the Zen Flow of Bryce Tiles
    Mozilla Confirms Full “AI Kill Switch” for Firefox, Arriving in Early 2026
    Rescuezilla Review 2025: The ‘Undo Button’ for Your Entire PC
    Tails OS Review 2025: The Ultimate Amnesic System for Total Privacy
    Facebook X (Twitter) Mastodon Bluesky Threads RSS
    • About Us
    • Cookie Policy
    • Terms & Conditions
    • Privacy Policy
    • Disclosure & Disclaimer
    • Contact
    • Our Authors
    • Cookie Policy (EU)
    © 2026 Designed by FeedCrux

    Type above and press Enter to search. Press Esc to cancel.

    Manage Consent
    To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
    Functional Always active
    The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
    Preferences
    The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
    Statistics
    The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
    Marketing
    The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
    • Manage options
    • Manage services
    • Manage {vendor_count} vendors
    • Read more about these purposes
    View preferences
    • {title}
    • {title}
    • {title}