OS Package Management Systems
Operating system package managers handle the installation, upgrade, and removal of system-level software. Each Linux distribution typically maintains its own package manager with its own package format and repository infrastructure.
Package Formats and Managers
Different distributions use different package formats:
| Distribution | Package Format | Manager |
|---|---|---|
| Debian/Ubuntu | .deb |
apt, dpkg |
| RHEL/Fedora | .rpm |
dnf, yum |
| openSUSE | .rpm |
zypper |
| Arch Linux | .pkg.tar.zst |
pacman |
| Alpine | .apk |
apk |
| Gentoo | Source (ebuilds) | emerge |
| macOS | Various | brew, MacPorts |
| NixOS | .nix |
nix-env, nix |
APT (Debian/Ubuntu)
APT (Advanced Package Tool) manages .deb packages. It resolves dependencies automatically and maintains a local cache of package metadata.
Common operations:
apt update # Update package lists apt upgrade # Upgrade installed packages apt install vim # Install a package apt remove vim # Remove a package apt autoremove # Remove unused dependencies apt search webserver # Search packages apt list --installed # List installed packages
DNF (Fedora/RHEL)
DNF (Dandified YUM) manages .rpm packages on Fedora and RHEL-based systems. It replaced the older yum tool.
dnf update # Update all packages dnf install vim # Install a package dnf remove vim # Remove a package dnf search webserver # Search packages dnf info vim # Show package details dnf list installed # List installed packages
Zypper (openSUSE)
Zypper is the command-line package manager for openSUSE and SUSE Linux Enterprise.
zypper refresh # Refresh repositories zypper update # Update packages zypper install vim # Install a package zypper remove vim # Remove a package zypper search vim # Search packages
Pacman (Arch)
Pacman manages binary packages for Arch Linux. It uses a simple package format and rolling release model.
pacman -Sy # Sync package databases pacman -S vim # Install a package pacman -R vim # Remove a package pacman -Syu # Full system upgrade pacman -Ss webserver # Search packages pacman -Qe # List explicitly installed packages
Homebrew (macOS/Linux)
Homebrew ("brew") is a popular package manager for macOS, also available on Linux. It installs packages to their own prefix (/usr/local on macOS, /home/linuxbrew/.linuxbrew on Linux).
brew update # Update formulae brew install vim # Install a package brew uninstall vim # Remove a package brew upgrade # Upgrade outdated packages brew search vim # Search formulae brew list # List installed packages
Nix-env (Nix)
The Nix package manager uses a purely functional model. Packages are stored in immutable /nix/store paths, enabling atomic upgrades and rollbacks.
nix-channel --update # Update channels nix-env -i vim # Install a package nix-env -e vim # Uninstall a package nix-env --upgrade # Upgrade packages nix search nixpkgs vim # Search packages nix-collect-garbage -d # Remove unused packages
Opkg (OpenWrt/Embedded)
Opkg is a lightweight package manager for embedded systems, derived from ipkg. It is the default package manager for OpenWrt.
opkg update # Update package lists opkg install vim # Install a package opkg remove vim # Remove a package opkg list-installed # List installed packages
Related Articles
- App containers: Article - Application container systems (snap, flatpak)
- Docker: Article - Containerized systems (dockerhub images)
- Language packages: Article - Programming language oriented package managers (pip, go, cargo)