api: YAML JSON TOON Database version: 1.0.0 format: toon dataset: id: 2922 slug: unix-package-management title: "Unix/Linux Package Management (apt, yum, dnf, brew, pacman)" description: "Package managers across distributions: Debian/Ubuntu (apt), RHEL/Fedora (yum/dnf), macOS (brew), Arch (pacman). Installation, removal, repository management." summary: "Package managers by platform with description, common commands, configuration files and notes: apt, yum, dnf, Homebrew, pacman and dpkg." use_when[2]: "You need the install, update or search command for a Linux or macOS package manager.",You are writing cross-distribution setup instructions. caveats[2]: Command names and defaults differ by distribution and version; yum is replaced by dnf on current Fedora and RHEL.,Installing packages needs privileges (sudo) and trust in the repository. related[4]: file-operations,shell-scripting-guide,infrastructure-as-code-tools,containerization entry_count: 6 fields[6]{section,field,type,example}: managers,name,string,apt (Advanced Package Tool) managers,platform,string,"Debian, Ubuntu, Linux Mint" managers,description,string,High-level package manager for Debian-based sys… managers,common_commands,array,"[8 items]" managers,config_files,array,"[3 items]" managers,notes,string,"Use apt-get for scripts (stable output), apt fo…" category: Unix Commands category_slug: unix-commands tags: "unix,linux,package-manager,apt,yum,dnf,brew,pacman" view_count: 37 created_at: 1777673262 updated_at: 1777673262 data: managers[6]: - name: apt (Advanced Package Tool) platform: "Debian, Ubuntu, Linux Mint" description: "High-level package manager for Debian-based systems. Handles dependency resolution, repository management, and package installation/removal." common_commands[8]: - "apt update": Update package index from repositories - "apt upgrade": Upgrade all upgradable packages - "apt install ": Install package and dependencies - "apt remove ": "Remove package, keep config files" - "apt purge ": Remove package and config files - "apt search ": Search package descriptions - "apt list --installed": List all installed packages - "apt show ": Show package details config_files[3]: /etc/apt/sources.list,/etc/apt/sources.list.d/,/etc/apt/apt.conf.d/ notes: "Use apt-get for scripts (stable output), apt for interactive use. sudo apt update before install/upgrade. apt full-upgrade handles distribution upgrades. .deb files can be installed via dpkg -i but dependencies aren't resolved automatically." - name: yum (Yellowdog Updater Modified) platform: "RHEL, CentOS, Fedora (legacy)" description: Legacy package manager for RHEL-based systems. Being replaced by dnf but still widely used on older systems. common_commands[8]: - "yum check-update": Check for available updates - "yum update": Update all packages - "yum install ": Install package - "yum remove ": Remove package - "yum search ": Search packages - "yum info ": Show package info - "yum list installed": List installed packages - "yum clean all": Clean package cache config_files[2]: /etc/yum.conf,/etc/yum.repos.d/ notes: "yum is deprecated in favor of dnf (Yum's successor). Still present on CentOS 7, RHEL 7, and older Fedora. Uses RPM packages. Transactions are logged in /var/log/yum.log." - name: dnf (Dandified Yum) platform: "Fedora, RHEL 8+, CentOS Stream, AlmaLinux, Rocky Linux" description: "Next-generation package manager for RPM-based distributions. Faster dependency resolution, cleaner API, better performance than yum." common_commands[8]: - "dnf check-update": Check for updates - "dnf update": Update all packages - "dnf install ": Install package - "dnf remove ": Remove package - "dnf search ": Search packages - "dnf info ": Show package details - "dnf autoremove": Remove orphaned dependencies - "dnf module list": List module streams (Fedora/RHEL) config_files[3]: /etc/dnf/dnf.conf,/etc/yum.repos.d/,/etc/dnf/modules.d/ notes: "dnf is backward-compatible with yum commands. Uses libsolv for dependency resolution (faster). Module streams enable multiple versions of same software (e.g., nodejs:14, nodejs:16)." - name: Homebrew (brew) platform: "macOS, Linux (via Linuxbrew)" description: Missing package manager for macOS. Installs packages to /usr/local (or ~/.linuxbrew on Linux). Simple formula-based system. Community-maintained. common_commands[8]: - "brew update": Update Homebrew and formulae - "brew upgrade": Upgrade all installed packages - "brew install ": Install package - "brew uninstall ": Remove package - "brew search ": Search formulae - "brew info ": Show package info - "brew list": List installed packages - "brew tap ": Add additional repository config_files[3]: /usr/local/Homebrew/Library/Taps/,~/.brew/ (Linuxbrew),/usr/local/etc/brew.git notes: "Installs from source by default (can use bottles = pre-built binaries). macOS GUI apps via brew install --cask. Linuxbrew requires build tools (gcc, make). Doesn't manage macOS system packages (use apt/dpkg in Linux subsystem)." - name: pacman platform: "Arch Linux, Manjaro" description: "Simple, fast package manager for Arch Linux. Binary packages, minimal dependency handling, rolling release model." common_commands[8]: - "pacman -Sy": Sync package databases - "pacman -Syu": Full system upgrade - "pacman -S ": Install package(s) - "pacman -R ": Remove package - "pacman -Rns ": Remove package and deps - "pacman -Ss ": Search packages - "pacman -Qi ": Show package info - "pacman -Ql ": List package files config_files[3]: /etc/pacman.conf,/etc/pacman.d/,/etc/pacman.d/mirrorlist notes: "Arch is rolling release: pacman -Syu updates everything. -Syy forces refresh. Use pacman -Q to query local DB. AUR (Arch User Repository) accessed via helpers like yay or paru (not official pacman)." - name: dpkg platform: "Debian, Ubuntu (low-level)" description: Low-level Debian package manager. Used by apt underneath. Handles .deb files directly without dependency resolution. common_commands[8]: - "dpkg -i ": Install .deb package - "dpkg -r ": Remove package (keep config) - "dpkg -P ": Purge package and config - "dpkg -l": List all installed packages - "dpkg -L ": List files installed by package - "dpkg -S ": Find which package owns file - "dpkg -c ": List contents of .deb file - "dpkg-reconfigure ": Re-run package config config_files[3]: /var/lib/dpkg/status,/var/lib/dpkg/available,/etc/apt/sources.list (for apt integration) notes: Use dpkg --force-all carefully. dpkg -i doesn't resolve dependencies (apt-get -f install fixes). dpkg-query provides more advanced querying. Configuration files stored in /etc and preserved on remove unless purged.