What Are Linux Package Managers?
Package managers handle installing, updating, and removing software on Linux. Each distribution family uses its own β apt for Debian/Ubuntu, dnf for Fedora, yum for RHEL/CentOS, pacman for Arch, and apk for Alpine.
How to Use This Tool
Select the package managers you want to compare, then search for an operation like "install" or "update." The tool shows equivalent commands side by side so you can translate between distributions instantly.
When This Comes in Handy
If you manage servers across multiple distributions or write Dockerfiles that target different base images, knowing the equivalent package manager commands saves time and prevents errors.
apt vs apt-get
On Debian and Ubuntu, apt is the friendlier front end with progress bars and combined commands such as apt list --upgradable. apt-get and apt-cache are the older tools with a stable command-line interface, which is why scripts and Dockerfiles use them β apt itself prints a warning that its CLI may change. Both use the same repositories and the same package database, so you can mix them freely.
yum vs dnf
dnf replaced yum on Fedora and on RHEL, CentOS Stream, Rocky Linux and AlmaLinux 8 and later. On those systems yum is just an alias for dnf, so old yum commands keep working. RHEL 7 and CentOS 7 still use the original yum. Fedora 41 moved to DNF5, a faster rewrite that keeps nearly all of the same commands.
Which package provides a file?
For a file that's already installed: dpkg -S /usr/bin/curl on Debian and Ubuntu, rpm -qf /usr/bin/curl on RHEL and Fedora, pacman -Qo /usr/bin/curl on Arch, and apk info --who-owns /usr/bin/curl on Alpine. To find a package that would provide a missing file or command: dnf provides '*/bin/htop', apt-file search bin/htop on Debian (install apt-file and run apt-file update first), or pacman -F htop after syncing the file database with pacman -Fy.
List installed packages and versions
apt list --installed or dpkg -l on Debian and Ubuntu; dnf list installed or rpm -qa on RHEL and Fedora; pacman -Q on Arch (pacman -Qe for explicitly installed packages only); apk info -v on Alpine. Pipe any of them into grep to check for one package, for example dpkg -l | grep openssl.
Hold a package at its current version
apt-mark hold nginx stops apt from upgrading nginx until you run apt-mark unhold nginx. On dnf, the versionlock plugin does the same: dnf versionlock add nginx (on DNF4 install python3-dnf-plugin-versionlock first). On Arch, add the package to IgnorePkg in /etc/pacman.conf. Hold sparingly β a held package also stops receiving its security fixes.
Package managers inside Dockerfiles
Keep images small and builds reproducible. On Debian and Ubuntu bases use apt-get update && apt-get install -y --no-install-recommends curl && rm -rf /var/lib/apt/lists/* in a single RUN, so the package index never lands in a layer. On Alpine, apk add --no-cache curl skips the cache entirely. On Fedora and RHEL-based images, follow dnf install -y curl with dnf clean all in the same RUN.