Package management

Software package management is the foundation that makes Linux operating systems powerful, flexible, and easy to maintain. It simplifies the software deployment process, ensuring the system is always stable and secure.

What is software package management?

Software package management is the process of installing, upgrading, configuring, and removing software on an operating system using package managers.

Package managers help:

  • Automatically find and install software
  • Resolve software dependencies
  • Keep software up to date
  • Easily remove or restore software
  • Manage multiple versions and traceability

Components of a software package management system:

Components Roles
Package Software package containing binary code, configuration, documentation, scripts…
Package Manager CLI tool to install, update, remove, search for packages (eg: apt, dnf)
Repository A place where software packages are stored. Can be local or remote (on the network)
Dependency Resolver Component that handles related software dependencies
Metadata Package information: name, version, architecture, dependencies, description…

How ​​the package manager works:

  1. Search for software:
apt search htop
  1. Install software (automatically handle dependencies):
sudo apt install htop
  1. Update the system:
sudo apt update && sudo apt upgrade
  1. Uninstall software:
sudo apt remove htop
  1. View package information:
apt show htop
Distro Package Manager Software packages Command examples
Ubuntu/Debian apt, dpkg .deb sudo apt install gimp
Fedora/RHEL/CentOS dnf, yum, rpm .rpm sudo dnf install gimp
Arch Linux pacman .pkg.tar.zst sudo pacman -S gimp
openSUSE zypper .rpm sudo zypper install gimp
Flatpak (multiplatform) flatpak .flatpakref flatpak install flathub gimp
Snap (multiplatform) snap .snap sudo snap install gimp

Advantages of software package management:

  • Automation: No need to compile, no need to worry about missing libraries.
  • Time saving: One command to install software with dependencies.
  • Ensure consistency: Software is tested for the correct distro.
  • Higher security: Easy to update and control the origin.