dnf command
Install, update and remove packages on Fedora, RHEL, Rocky and AlmaLinux.
- Package management
- Package dnf
- 10 options · 9 examples
Syntax
dnf [options] command [package…]Provided by the dnf package. Run man dnf for the full manual.
Common options
| Option | What it does |
|---|---|
install | Install packages |
remove | Remove packages |
upgrade | Upgrade packages |
check-update | List available updates |
search | Search packages |
info | Package details |
list installed | Installed packages |
provides FILE | Which package provides a file |
history | Past transactions |
-y | Answer yes |
Examples
Install a package
sudo dnf install nginxUpgrade everything
sudo dnf upgrade -yCheck for updates
dnf check-updateRemove a package
sudo dnf remove httpdSearch
dnf search redisWhich package provides a command
dnf provides /usr/bin/digList installed packages
dnf list installedEnable EPEL on RHEL-compatible systems
sudo dnf install epel-releaseUndo the last transaction
sudo dnf history undo last
No example matches. Check the options table or search the guides.
Tips
yumis a link todnfon current RHEL, Rocky and AlmaLinux.
dnf guides
- Top 5 Yum Repositories for CentOS/RHEL 7/6/5 Linux · Updated Apr 2025
- How to Exclude Specific Packages from Yum Update Linux · Updated Apr 2025
- DNF Command in Linux with Practical Examples Linux Commands · Updated Apr 2025
- DNF vs YUM: A Detailed Examination of Dependency Management Linux · Updated Apr 2025
- How To Add/Remove Repository In Fedora using DNF Linux · Updated Apr 2025
- Downloading DNF Package Dependencies Without Installing Them Linux · Updated Apr 2025
