dnf
Overview
The dnf
(Dandified Yum) command is the next-generation package manager for RPM-based Linux distributions. It succeeds yum
with improved dependency resolution and performance.
Syntax
dnf [options] command [package...]
Common Commands
Command | Description |
---|---|
install |
Install packages |
update |
Update packages |
remove |
Remove packages |
search |
Search packages |
info |
Show package info |
list |
List packages |
check-update |
Check updates |
clean |
Clean cache |
group |
Group operations |
history |
Transaction history |
repolist |
List repositories |
provides |
Find file provider |
module |
Module operations |
downgrade |
Downgrade package |
Common Options
Option | Description |
---|---|
-y |
Assume yes |
-q |
Quiet mode |
--nogpgcheck |
Skip GPG check |
--enablerepo |
Enable repository |
--disablerepo |
Disable repository |
--exclude |
Exclude packages |
--downloadonly |
Download only |
--best |
Best package version |
--allowerasing |
Allow erasing |
Key Use Cases
- Package management
- System updates
- Module management
- Repository control
- System maintenance
Examples with Explanations
Example 1: Install Package
dnf install package_name
Install specific package
Example 2: Update System
dnf update
Update all packages
Example 3: Module Operations
dnf module list
List available modules
Common Usage Patterns
System update:
dnf check-update && dnf update
Group install:
dnf group install "Development Tools"
Module enable:
dnf module enable nodejs:12
Security Considerations
- Repository security
- GPG verification
- Root privileges
- Network security
- Version control
Additional Resources
Best Practices
- Regular updates
- Clean cache
- Verify packages
- Backup configuration
- Test updates
Module Management
- Enable/disable
- Install/remove
- Switch streams
- Reset modules
- List profiles
Troubleshooting
- Dependency issues
- Repository problems
- Network errors
- Space issues
- Module conflicts