The dnf
command is a package manager for RPM-based Linux distributions, such as Fedora and CentOS. It is used to install, update, remove, and manage software packages on your system, making it easier to handle software dependencies and maintain your system’s software.
The basic syntax of the dnf
command is as follows:
dnf [options] [arguments]
install
: Install a package.remove
: Remove a package.update
: Update installed packages to the latest version.search
: Search for a package in the repositories.list
: List available packages or installed packages.info
: Display detailed information about a package.clean
: Clean up cached files.Here are some practical examples of using the dnf
command:
To install a package, use the install
option:
dnf install package-name
To remove an installed package:
dnf remove package-name
To update all installed packages to their latest versions:
dnf update
To search for a specific package:
dnf search package-name
To list all installed packages on your system:
dnf list installed
To get detailed information about a specific package:
dnf info package-name
dnf update
regularly to keep your system up to date with the latest security patches and software improvements.--assumeyes
option with commands to automatically answer “yes” to prompts, which can be helpful in scripts.dnf list package-name
before installing to ensure you are getting the desired version.