- dnf caches information and databses to speed up performance. To remove cached information:
dnf clean [ packages | metadata | expire-cache | rpmdb | plugins | all ]
You can also toggle use of a particular repo on or off by changing the value of enabled, or using the –disablerepo {repo} and ** –enablerepo {repo}** options.
- dnf replaced yum during the RHEL/CentOS 7 to 8 transition.
- dnf queries:
- To search for a package with a keyword:
dnf search {keyword}
- To display information about a package:
dnf info {package}
- To list packages installed, available, or updates:
dnf list [installed | updates | available ]
- To show information about package groups installed:
dnf grouplist
- To show information about a package groups:
dnf groupinfo {package}
- To show owner of the package for a file:
dnf provides {directory}
- To install:
sudo dnf install {package}
- To install locally:
sudo dnf localinstall {package}
- To install a specific software group from a repository:
sudo dnf groupinstall {package}
- To remove a package:
sudo dnf remove {package}
- To update a package:
sudo dnf update {package}
- List dnf plugins:
sudo dnf list "dnf-plugin*"
- List of enabled repos:
sudo dnf repolist
- Interactive shell which to run multiple dnf:
sudo dnf shell {file}
where file is the list of commands.
- Only download the package with the flag –downloadonly
- Clean up locally stored files and metadata:
sudo dnf clean [packages|metadata|expire-cache|rpmdb|plugins|all]
- zypper: serves the same function as dnf for OpenSUSE.