Compare apt and dnf package management.
BeginnerConceptPackages, Shell & Text Tools
Answer
| Task | Debian/Ubuntu | RHEL/Fedora |
|---|---|---|
| Refresh metadata | apt update |
dnf makecache (automatic) |
| Install | apt install nginx |
dnf install nginx |
| Upgrade all | apt upgrade |
dnf upgrade |
| Remove | apt remove / purge |
dnf remove |
| Search | apt search |
dnf search |
| Package of a file | dpkg -S /usr/bin/curl |
rpm -qf /usr/bin/curl |
Low-level tools are dpkg and rpm; apt and dnf add repository and dependency resolution.
More on Packages, Shell & Text Tools
What is the difference between `apt upgrade` and `apt full-upgrade`?IntermediateHow do you find which package provides a file or command?BeginnerHow do you pin or hold a package version?IntermediateHow are repositories and their GPG keys configured?AdvancedWhat is the difference between a login shell and an interactive non-login shell?IntermediateWhat does `set -euo pipefail` do in a bash script?Intermediate