dnf

dnf Cheatsheet #

dnf (Dandified YUM) is the next-generation version of the yum package manager used in Fedora and other Red Hat-based distributions. It handles the installation, removal, and management of software packages on these systems.

Basic Commands #

Command/OptionExampleDescription
dnf installsudo dnf install package-nameInstall a package
dnf removesudo dnf remove package-nameRemove a package
dnf updatesudo dnf updateUpdate all installed packages
dnf upgradesudo dnf upgradeUpgrade all installed packages
dnf searchdnf search package-nameSearch for a package
dnf infodnf info package-nameDisplay information about a package
dnf listdnf list installedList all installed packages
dnf list availablednf list availableList all available packages
dnf clean allsudo dnf clean allClean all cached files
dnf repoquerydnf repoquery --list package-nameQuery the repository for package details

Repository Management #

Command/OptionExampleDescription
dnf repolistdnf repolistList all enabled repositories
dnf-config-manager --add-reposudo dnf-config-manager --add-repo=https://example.repoAdd a new repository
dnf-config-manager --set-enabledsudo dnf-config-manager --set-enabled repo-nameEnable a repository
dnf-config-manager --set-disabledsudo dnf-config-manager --set-disabled repo-nameDisable a repository

Package Group Management #

Command/OptionExampleDescription
dnf groupinstallsudo dnf groupinstall "Development Tools"Install a package group
dnf groupremovesudo dnf groupremove "Development Tools"Remove a package group
dnf groupinfodnf groupinfo "Development Tools"Display information about a package group

History and Transactions #

Command/OptionExampleDescription
dnf historydnf historyShow transaction history
dnf history infodnf history info transaction-idShow details about a specific transaction
dnf history undosudo dnf history undo transaction-idUndo a specific transaction
dnf history redosudo dnf history redo transaction-idRedo a specific transaction

Plugin Management #

Command/OptionExampleDescription
dnf plugin listdnf plugin listList all available plugins
dnf plugin disablesudo dnf plugin disable plugin-nameDisable a specific plugin
dnf plugin enablesudo dnf plugin enable plugin-nameEnable a specific plugin

This cheatsheet covers the essential dnf commands for package management, repository management, and history operations in Fedora and other Red Hat-based distributions.

dnf

Explore our comprehensive cheatsheets to enhance your knowledge and efficiency. Each cheatsheet provides detailed command options, examples, and descriptions to help you master various tools and technologies.