Skip to content

Package Manager Comparison(1)

Name

Compare commands across apt, yum, dnf, pacman, and apk. Toggle managers, search operations, and translate commands between distributions.

Install / Remove

Install a package

aptsudo apt install <pkg>
yumsudo yum install <pkg>
dnfsudo dnf install <pkg>
pacmansudo pacman -S <pkg>
apksudo apk add <pkg>

Remove a package

aptsudo apt remove <pkg>
yumsudo yum remove <pkg>
dnfsudo dnf remove <pkg>
pacmansudo pacman -R <pkg>
apksudo apk del <pkg>

Remove with dependencies

aptsudo apt autoremove <pkg>
yumsudo yum autoremove <pkg>
dnfsudo dnf autoremove <pkg>
pacmansudo pacman -Rns <pkg>
apksudo apk del <pkg> && sudo apk fix

Install from local file

aptsudo dpkg -i <file.deb>
yumsudo yum localinstall <file.rpm>
dnfsudo dnf install <file.rpm>
pacmansudo pacman -U <file.pkg.tar.zst>
apksudo apk add --allow-untrusted <file.apk>

Downgrade a package

aptsudo apt install <pkg>=<version>
yumsudo yum downgrade <pkg>
dnfsudo dnf downgrade <pkg>
pacmansudo pacman -U <older-pkg-file>
apksudo apk add <pkg>=<version>

Update / Upgrade

Update package list

aptsudo apt update
yumsudo yum check-update
dnfsudo dnf check-update
pacmansudo pacman -Sy
apksudo apk update

Upgrade all packages

aptsudo apt upgrade
yumsudo yum update
dnfsudo dnf upgrade
pacmansudo pacman -Syu
apksudo apk upgrade

List available updates

aptapt list --upgradable
yumyum check-update
dnfdnf check-update
pacmanpacman -Qu
apkapk version -l '<'

Query / Info

Search for a package

aptapt search <keyword>
yumyum search <keyword>
dnfdnf search <keyword>
pacmanpacman -Ss <keyword>
apkapk search <keyword>

Show package info

aptapt show <pkg>
yumyum info <pkg>
dnfdnf info <pkg>
pacmanpacman -Si <pkg>
apkapk info -a <pkg>

List installed packages

aptapt list --installed
yumyum list installed
dnfdnf list installed
pacmanpacman -Q
apkapk list -I

Show package dependencies

aptapt depends <pkg>
yumyum deplist <pkg>
dnfdnf repoquery --requires <pkg>
pacmanpacman -Si <pkg> | grep Depends
apkapk info -R <pkg>

Show which package owns a file

aptdpkg -S <file>
yumyum provides <file>
dnfdnf provides <file>
pacmanpacman -Qo <file>
apkapk info --who-owns <file>

List files in a package

aptdpkg -L <pkg>
yumrpm -ql <pkg>
dnfdnf repoquery -l <pkg>
pacmanpacman -Ql <pkg>
apkapk info -L <pkg>

Download package without installing

aptapt download <pkg>
yumyumdownloader <pkg>
dnfdnf download <pkg>
pacmanpacman -Sw <pkg>
apkapk fetch <pkg>

Show package changelog

aptapt changelog <pkg>
yumyum changelog <pkg>
dnfdnf changelog <pkg>
pacmanpacman -Qc <pkg>
apkN/A

Maintenance

Clean cache

aptsudo apt clean
yumsudo yum clean all
dnfsudo dnf clean all
pacmansudo pacman -Sc
apksudo apk cache clean

Hold / pin a package version

aptsudo apt-mark hold <pkg>
yumecho "exclude=<pkg>" >> /etc/yum.conf
dnfsudo dnf versionlock add <pkg>
pacmanEdit IgnorePkg in /etc/pacman.conf
apkapk add <pkg>=<version>

Repository

Add a repository

aptsudo add-apt-repository <repo>
yumsudo yum-config-manager --add-repo <url>
dnfsudo dnf config-manager --add-repo <url>
pacmanEdit /etc/pacman.conf
apkecho "<url>" >> /etc/apk/repositories

Remove a repository

aptsudo add-apt-repository --remove <repo>
yumsudo rm /etc/yum.repos.d/<repo>.repo
dnfsudo rm /etc/yum.repos.d/<repo>.repo
pacmanEdit /etc/pacman.conf
apkEdit /etc/apk/repositories

List repositories

aptapt-cache policy
yumyum repolist
dnfdnf repolist
pacmancat /etc/pacman.d/mirrorlist
apkcat /etc/apk/repositories
sponsored

Guide

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.

See also