DNF Cheat Sheet

Mastering DNF: Your Guide to Package Management on Fedora

Fedora’s powerful package manager, DNF, empowers you to effortlessly manage software on your system. Whether you’re a seasoned developer or a curious newcomer, this comprehensive guid…


This content originally appeared on DEV Community and was authored by Gustavo Charalla

Mastering DNF: Your Guide to Package Management on Fedora

Fedora's powerful package manager, DNF, empowers you to effortlessly manage software on your system. Whether you're a seasoned developer or a curious newcomer, this comprehensive guide will equip you with the essential DNF commands and techniques to navigate the world of software installation, updates, and configuration.

Finding the Right Software

Finding the perfect software for your needs is just a command away. DNF offers flexible search options to pinpoint exactly what you're looking for.

  • Searching by name or description:
    • dnf search foo - This command searches for packages named "foo" or containing "foo" in their descriptions.
  • Finding packages providing specific functionality:
    • dnf provides foo - If you know a specific feature or functionality you need (like "zip file compression"), this command finds the package that offers it.
  • Discovering related packages:
    • dnf group list --verbose - DNF groups provide collections of related software. This command displays available groups and their descriptions.
  • Getting a visual overview:
    • gnome-software - Launch the user-friendly GNOME Software center for a graphical interface to browse and manage packages.

Getting Detailed Information

Once you've found a package, you can delve into its details for a comprehensive understanding.

  • Package overview:
    • dnf info foo - This command provides detailed information about a package, including its install status, size, description, and other metadata.
  • Exploring package groups:
    • dnf info @design-suite - Get a breakdown of all the packages included in the "design-suite" group.
  • Listing package contents:
    • dnf repoquery --list foo - Discover all the files that are part of a specific package.

Installing and Uninstalling with Ease

DNF makes installing and uninstalling software a straightforward process.

  • Adding new software:
    • dnf install foo - Install the "foo" package. Adding the -y flag automatically confirms all prompts.
    • dnf install @design-suite - Install a whole group of packages, like "design-suite".
  • Removing software:
    • dnf remove foo - Uninstall the "foo" package.

Downloading for Later Use

For archiving, modification, or offline installation, DNF provides package download capabilities.

  • Basic download:
    • dnf download foo - Download the "foo" package without installation.
  • Resolving dependencies:
    • dnf download --resolve foo - Download "foo" and any missing dependencies, but don't install.
  • Downloading all dependencies:
    • dnf download --resolve --alldeps foo - Download "foo" and all its dependencies, including those already installed.
  • Getting the source code:
    • dnf download --source foo - Download the source RPM (SRPM) for the "foo" package.

Managing Dependencies

Software often relies on other packages, and DNF handles these dependencies intelligently.

  • Listing dependencies:
    • dnf repoquery --deplist foo - See all the dependencies required by the "foo" package.
  • Resolving conflicts:
    • dnf --allowerasing - This option allows DNF to remove packages if necessary to resolve dependency issues.
  • Skipping broken dependencies:
    • dnf --skip-broken - This option skips packages with unsolvable dependencies, allowing you to proceed with the installation of other packages.
  • Installing build dependencies:
    • dnf builddep foo - Install the build dependencies required for compiling a package, spec file, or source RPM.

Configuring Your Repositories

Repositories are essential for storing and accessing packages. DNF lets you manage these repositories seamlessly.

  • Listing repositories:
    • dnf repolist - Show enabled repositories.
    • dnf repolist --all - List all registered repositories, including those disabled.
  • Enabling repositories:
    • dnf config-manager --enable powertools - Enable the repository named "powertools".
  • Adding repositories:
    • dnf config-manager --add-repo https://example.com/updates/x86_64 - Add and enable a repository from a specific URL. Make sure the URL points to a valid repository with a repomd.xml file.
  • Reviewing configuration:
    • dnf config-manager --dump - Display the current configuration values.

With this comprehensive guide, you're ready to confidently navigate the world of software management using DNF. Remember to consult the official documentation and explore the wealth of additional commands and options available for advanced tasks. Happy package managing!


This content originally appeared on DEV Community and was authored by Gustavo Charalla


Print Share Comment Cite Upload Translate Updates
APA

Gustavo Charalla | Sciencx (2024-10-31T20:50:06+00:00) DNF Cheat Sheet. Retrieved from https://www.scien.cx/2024/10/31/dnf-cheat-sheet/

MLA
" » DNF Cheat Sheet." Gustavo Charalla | Sciencx - Thursday October 31, 2024, https://www.scien.cx/2024/10/31/dnf-cheat-sheet/
HARVARD
Gustavo Charalla | Sciencx Thursday October 31, 2024 » DNF Cheat Sheet., viewed ,<https://www.scien.cx/2024/10/31/dnf-cheat-sheet/>
VANCOUVER
Gustavo Charalla | Sciencx - » DNF Cheat Sheet. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/10/31/dnf-cheat-sheet/
CHICAGO
" » DNF Cheat Sheet." Gustavo Charalla | Sciencx - Accessed . https://www.scien.cx/2024/10/31/dnf-cheat-sheet/
IEEE
" » DNF Cheat Sheet." Gustavo Charalla | Sciencx [Online]. Available: https://www.scien.cx/2024/10/31/dnf-cheat-sheet/. [Accessed: ]
rf:citation
» DNF Cheat Sheet | Gustavo Charalla | Sciencx | https://www.scien.cx/2024/10/31/dnf-cheat-sheet/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.