Linux/Unix: Package Management by Distribution – APT, DNF, RPM, Pacman, and Zypper Explained
Introduction – Install, Upgrade & Manage Software the Linux Way
One of the most powerful aspects of Linux is its package management system, which allows users to install, upgrade, remove, and manage software directly from the command line. However, these tools vary depending on the Linux distribution you use. Whether you’re on Ubuntu, Fedora, Arch, or SUSE, this guide will show you the essential package managers and commands.
In this guide, you’ll learn:
- Key package management tools for major Linux distros
- How to install, remove, and update packages
- Syntax differences between APT, DNF, Pacman, Zypper, and Snap
Topics Covered
| Distribution | Package Manager |
|---|---|
| Debian/Ubuntu-based | apt, dpkg, snap |
| RHEL/CentOS/Fedora-based | yum, dnf, rpm |
| Arch Linux-based | pacman |
| SUSE Linux-based | zypper |
Debian-based (apt, dpkg, snap)
APT – Advanced Packaging Tool
sudo apt update # Update package list
sudo apt upgrade # Upgrade all packages
sudo apt install nginx # Install package
sudo apt remove nginx # Remove package
dpkg – Low-Level Package Installer
sudo dpkg -i package.deb # Install .deb file
sudo dpkg -r nginx # Remove package
snap – Universal Linux Packages
sudo snap install vlc # Install a snap package
sudo snap remove vlc # Remove snap package
Snap packages are sandboxed and work across distros.
RHEL-based (yum, dnf, rpm)
DNF – Modern Package Manager (Fedora/RHEL 8+)
sudo dnf install httpd
sudo dnf update
sudo dnf remove httpd
YUM – Older Tool (RHEL/CentOS 7)
sudo yum install httpd
yum is mostly replaced by dnf in newer systems.
RPM – Manual .rpm File Handling
sudo rpm -ivh package.rpm # Install
sudo rpm -e package-name # Erase
Arch-based (pacman)
pacman – Fast & Lightweight
sudo pacman -Syu # Sync & update all
sudo pacman -S firefox # Install package
sudo pacman -R firefox # Remove package
sudo pacman -Ss browser # Search packages
Uses binary .pkg.tar.zst files from official and AUR repositories.
SUSE (zypper)
zypper – SUSE’s Package Manager
sudo zypper refresh # Refresh repo data
sudo zypper install apache2 # Install software
sudo zypper remove apache2 # Remove software
Similar to dnf, but tailored for openSUSE and SLE.
Summary – Recap & Next Steps
Every Linux distribution has its own preferred package manager, but all of them offer powerful tools for software automation, system upgrades, and dependency management. Understanding these tools lets you confidently manage your environment across any distro.
Key Takeaways:
- Use
apt,yum/dnf,pacman, orzypperdepending on your distribution - Use
snapfor universal Linux apps across distros - Low-level tools like
dpkgandrpmhandle direct package files - Refresh/update repositories before installing software
Real-World Applications:
- Install LAMP stack across different Linux servers
- Automate daily system updates using native CLI tools
- Resolve dependencies using
--fix-brokenor-Syuflags - Test new software with Snap or Flatpak without affecting system-wide libs
Frequently Asked Questions
What’s the difference between APT and DPKG?
apt is higher-level (resolves dependencies), while dpkg is used for local .deb files and doesn’t fetch from repositories.
Can I use Snap on Fedora or Arch?
Yes, but you may need to install the Snap daemon first.
Why is DNF replacing YUM?
DNF is faster, more efficient, and has better dependency resolution and Python 3 support.
Is Pacman compatible with .deb or .rpm files?
No. Pacman uses its own .pkg.tar.zst format.
How do I install multiple packages at once with APT or DNF?
Example:
sudo apt install git curl vim
sudo dnf install git curl vim
Share Now :
