Package Manager Translator

The same task in apt, dnf, pacman, zypper, apk, Homebrew and winget
The same job in apt, dnf, pacman, zypper, apk, Homebrew and winget. Paste a command you know, like apt install nginx, and see it on every other system, or browse the 33 everyday tasks below.
RUNS ENTIRELY IN YOUR BROWSER

Examples:

It translates the command, not package names: Apache is apache2 on Debian and Ubuntu but httpd on Fedora and RHEL. Got an error from apt or dnf? Try the Error Message Decoder.

Commands that change the system need sudo (or an administrator terminal on Windows). Don't run Homebrew with sudo. Click any command to copy it.

TaskaptDebian, Ubuntu, Mint, Pop!_OSdnfFedora, RHEL 8+, Rocky, AlmapacmanArch, Manjaro, EndeavourOSzypperopenSUSE, SUSE Linux EnterpriseapkAlpine Linux and many Docker imagesHomebrewmacOSwingetWindows 10 and 11
Everyday
Refresh the package listsapt updatednf makecachednf also refreshes on its own when the lists are oldpacman -SyuRefresh and upgrade together. Don't run pacman -Sy and then install: that's a partial upgrade, which Arch doesn't supportzypper refreshapk updatebrew updatewinget source update
Upgrade all packagesapt upgradeRun apt update first. apt full-upgrade also adds or removes packages when an upgrade needs itdnf upgradepacman -Syuzypper updateOn openSUSE Tumbleweed use zypper dupapk upgradeapk -U upgrade refreshes the lists firstbrew upgradewinget upgrade --all
Upgrade one packageapt install --only-upgrade <pkg>Upgrades it only if it is already installeddnf upgrade <pkg>Not supported: Arch expects everything to be upgraded together with pacman -Syuzypper update <pkg>apk add --upgrade <pkg>brew upgrade <pkg>winget upgrade <pkg>
Install a packageapt install <pkg>dnf install <pkg>pacman -S <pkg>zypper install <pkg>apk add <pkg>brew install <pkg>winget install <pkg>Use --id <Package.Id> -e for an exact match
Remove a packageapt remove <pkg>dnf remove <pkg>pacman -R <pkg>pacman -Rs also removes dependencies nothing else needszypper remove <pkg>Add --clean-deps to remove dependencies nothing else needsapk del <pkg>brew uninstall <pkg>winget uninstall <pkg>
Remove a package and its config filesapt purge <pkg>No separate command: dnf remove deletes unchanged configs and keeps edited ones as .rpmsavepacman -Rn <pkg>-Rns also removes dependencies nothing else needsNo separate command: edited configs are kept as .rpmsaveapk del --purge <pkg>brew uninstall --zap <pkg>Casks (apps) onlyNo equivalent
Remove dependencies nothing needs any moreapt autoremovednf autoremovepacman -Qdtq | pacman -Rns -Shows an error if there are nonezypper packages --unneededLists them; remove with zypper removeNot needed: apk removes them automaticallybrew autoremoveNo equivalent
Reinstall a packageapt install --reinstall <pkg>dnf reinstall <pkg>pacman -S <pkg>zypper install --force <pkg>apk fix -r <pkg>brew reinstall <pkg>Uninstall, then install again
Install a downloaded package fileapt install ./<file>Keep the ./ so apt treats it as a file, not a package namednf install ./<file>pacman -U ./<file>zypper install ./<file>apk add --allow-untrusted ./<file>Only for files you trust; the flag skips the signature checkNo equivalent for package filesRun the downloaded installer directly
Download a package without installing itapt download <pkg>dnf download <pkg>pacman -Sw <pkg>zypper install --download-only <pkg>apk fetch <pkg>brew fetch <pkg>No equivalent in all versions
Finding things
Show details about a packageapt show <pkg>dnf info <pkg>pacman -Si <pkg>Use pacman -Qi for an installed packagezypper info <pkg>apk info -a <pkg>brew info <pkg>winget show <pkg>
List installed packagesapt list --installeddnf list --installedpacman -Qzypper search --installed-onlyapk list --installedOr apk info for names onlybrew listwinget list
List packages you installed yourselfapt-mark showmanualdnf repoquery --userinstalledpacman -QeNo direct equivalentcat /etc/apk/worldThe world file lists what you asked forbrew leavesFormulae that nothing else depends onNo equivalent
List packages with updates availableapt list --upgradableRun apt update firstdnf check-updatecheckupdatesFrom pacman-contrib; safe because it uses a separate copy of the lists. pacman -Qu works after a full -Syuzypper list-updatesapk list --upgradablebrew outdatedwinget upgradeWith no arguments it lists available upgrades
Which package owns this file?dpkg -S <path>rpm -qf <path>pacman -Qo <path>rpm -qf <path>apk info --who-owns <path>No equivalent (Homebrew files live under its Cellar folder)No equivalent
List the files a package installeddpkg -L <pkg>rpm -ql <pkg>pacman -Ql <pkg>rpm -ql <pkg>apk info -L <pkg>brew list <pkg>No equivalent
Which package provides a command I don't have?apt-file search bin/<cmd>Install it once: apt install apt-file && apt-file updatednf provides '*/bin/<cmd>'pacman -F <cmd>Run pacman -Fy once to download the file listszypper search --provides /usr/bin/<cmd>apk search 'cmd:<cmd>'No built-in equivalentNo equivalent
Show what a package depends onapt-cache depends <pkg>dnf repoquery --requires <pkg>pactree <pkg>From pacman-contrib; pacman -Qi <pkg> also lists "Depends On"zypper info --requires <pkg>apk info -R <pkg>brew deps <pkg>No equivalent
Show what depends on a packageapt-cache rdepends --installed <pkg>Without --installed it includes packages you don't havednf repoquery --installed --whatrequires <pkg>pactree -r <pkg>From pacman-contribzypper search --requires <pkg>apk info -r <pkg>brew uses --installed <pkg>No equivalent
Versions and holds
Show the versions availableapt list -a <pkg>Or apt-cache policy <pkg>, which also shows each repositorydnf list --showduplicates <pkg>Repositories carry one version; older ones are in /var/cache/pacman/pkg or the Arch Linux Archivezypper search -s <pkg>apk policy <pkg>brew info <pkg>Other versions exist only as separate formulae such as python@3.11winget show <pkg> --versions
Install a specific versionapt install <pkg>=<ver>dnf install <pkg>-<ver>To go back a version: dnf downgrade <pkg>pacman -U <file>Using an older package file from /var/cache/pacman/pkgzypper install <pkg>=<ver>Add --oldpackage to downgradeapk add <pkg>=<ver>This also pins it to that versionbrew install <pkg>@<ver>Only where a versioned formula existswinget install <pkg> --version <ver>
Hold a package at its current versionapt-mark hold <pkg>dnf versionlock add <pkg>Built into dnf5; on dnf4 install python3-dnf-plugin-versionlock firstAdd it to the IgnorePkg line in /etc/pacman.confzypper addlock <pkg>apk add <pkg>=<ver>Pins it in /etc/apk/worldbrew pin <pkg>winget pin add <pkg>
Release a holdapt-mark unhold <pkg>dnf versionlock delete <pkg>Remove it from IgnorePkg in /etc/pacman.confzypper removelock <pkg>apk add <pkg>Adding it again without a version removes the pinbrew unpin <pkg>winget pin remove <pkg>
List held packagesapt-mark showholddnf versionlock listgrep IgnorePkg /etc/pacman.confzypper lockscat /etc/apk/worldbrew list --pinnedwinget pin list
Cleaning and repair
Clear the download cacheapt cleanapt autoclean removes only files that can no longer be downloadeddnf clean allpacman -Scpaccache -r (pacman-contrib) keeps the last three versions, which is safer for downgradeszypper cleanapk cache cleanOnly does something if a local cache is set upbrew cleanupNo equivalent
Fix broken or half-installed packagesapt --fix-broken installAfter an interrupted install, run dpkg --configure -a firstdnf checkReports problems; then reinstall or dnf distro-sync the packages it namespacman -DkChecks that dependencies are metzypper verifyapk fixbrew doctorDiagnoses problems and suggests fixesNo equivalent
Show the install historyless /var/log/apt/history.logdnf historyless /var/log/pacman.logless /var/log/zypp/historyNo history logNo history logNo history log
Undo the last transactionNo undo; reinstall or remove by hand using the history logdnf history undo lastNo undo; reinstall older files from the cacheNo undo; on Btrfs systems, roll back with snapperNo undoNo undoNo undo
Repositories
List the repositories in useapt policyThe files live in /etc/apt/sources.list and /etc/apt/sources.list.d/dnf repolistpacman-conf --repo-listzypper reposcat /etc/apk/repositoriesbrew tapwinget source list
Add a repositoryadd-apt-repository ppa:<name>Ubuntu PPAs. For other repositories, add a file in /etc/apt/sources.list.d/ with its signing keydnf config-manager addrepo --from-repofile=<url>dnf5 syntax; dnf4 uses dnf config-manager --add-repo <url>Add a [repo] section to /etc/pacman.confzypper addrepo <url> <name>echo '<url>' >> /etc/apk/repositoriesThen run apk updatebrew tap <name>winget source add --name <name> --arg <url>
Moving to a new machine
Save a list of what you installedapt-mark showmanual > pkgs.txtdnf repoquery --userinstalled > pkgs.txtpacman -Qqe > pkgs.txtNo direct equivalentcp /etc/apk/world pkgs.txtbrew bundle dumpWrites a Brewfilewinget export -o pkgs.json
Install everything from that listxargs -a pkgs.txt apt installxargs -a pkgs.txt dnf installpacman -S --needed - < pkgs.txtNo direct equivalentapk add $(cat pkgs.txt)brew bundleReads the Brewfile in the current folderwinget import -i pkgs.json

Which package manager does my system use?

Not sure? cat /etc/os-release names your Linux distribution.