api: YAML JSON TOON Database
version: 1.0.0
format: json
dataset:
  id: 35
  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:
    - You need the install, update or search command for a Linux or macOS package manager.
    - You are writing cross-distribution setup instructions.
  caveats:
    - 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:
    - file-operations
    - shell-scripting-guide
    - infrastructure-as-code-tools
    - containerization
  category: Unix Commands
  category_slug: unix-commands
  tags: unix,linux,package-manager,apt,yum,dnf,brew,pacman
  view_count: 0
  created_at: 1777673262
  updated_at: 1777673262
  entry_count: 6
  fields:
    - section: managers
      field: name
      type: string
      example: apt (Advanced Package Tool)
    - section: managers
      field: platform
      type: string
      example: Debian, Ubuntu, Linux Mint
    - section: managers
      field: description
      type: string
      example: High-level package manager for Debian-based sys…
    - section: managers
      field: common_commands
      type: array
      example: "[8 items]"
    - section: managers
      field: config_files
      type: array
      example: "[3 items]"
    - section: managers
      field: notes
      type: string
      example: Use apt-get for scripts (stable output), apt fo…
data:
  managers:
    - 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:
        - apt update: Update package index from repositories
        - apt upgrade: Upgrade all upgradable packages
        - apt install <pkg>: Install package and dependencies
        - apt remove <pkg>: Remove package, keep config files
        - apt purge <pkg>: Remove package and config files
        - apt search <term>: Search package descriptions
        - apt list --installed: List all installed packages
        - apt show <pkg>: Show package details
      config_files:
        - /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:
        - yum check-update: Check for available updates
        - yum update: Update all packages
        - yum install <pkg>: Install package
        - yum remove <pkg>: Remove package
        - yum search <term>: Search packages
        - yum info <pkg>: Show package info
        - yum list installed: List installed packages
        - yum clean all: Clean package cache
      config_files:
        - /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:
        - dnf check-update: Check for updates
        - dnf update: Update all packages
        - dnf install <pkg>: Install package
        - dnf remove <pkg>: Remove package
        - dnf search <term>: Search packages
        - dnf info <pkg>: Show package details
        - dnf autoremove: Remove orphaned dependencies
        - dnf module list: List module streams (Fedora/RHEL)
      config_files:
        - /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:
        - brew update: Update Homebrew and formulae
        - brew upgrade: Upgrade all installed packages
        - brew install <pkg>: Install package
        - brew uninstall <pkg>: Remove package
        - brew search <term>: Search formulae
        - brew info <pkg>: Show package info
        - brew list: List installed packages
        - brew tap <repo>: Add additional repository
      config_files:
        - /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:
        - pacman -Sy: Sync package databases
        - pacman -Syu: Full system upgrade
        - pacman -S <pkg>: Install package(s)
        - pacman -R <pkg>: Remove package
        - pacman -Rns <pkg>: Remove package and deps
        - pacman -Ss <term>: Search packages
        - pacman -Qi <pkg>: Show package info
        - pacman -Ql <pkg>: List package files
      config_files:
        - /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:
        - dpkg -i <file.deb>: Install .deb package
        - dpkg -r <pkg>: Remove package (keep config)
        - dpkg -P <pkg>: Purge package and config
        - dpkg -l: List all installed packages
        - dpkg -L <pkg>: List files installed by package
        - dpkg -S <file>: Find which package owns file
        - dpkg -c <file.deb>: List contents of .deb file
        - dpkg-reconfigure <pkg>: Re-run package config
      config_files:
        - /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.
