Top 5 Linux Package Managers You Should Know
One of the best features of Linux is its powerful package management systems. Package managers allow you to easily install, update, and remove applications on your Linux distribution.
Instead of having to compile applications from the source or hunt down installation files, you can use a simple command to manage thousands of apps. Package managers resolve dependencies, download packages, and integrate applications into your system.
There are a variety of package managers used by the major Linux distributions. Here are 5 of the best Linux package managers and how to use them:
1. APT (Debian/Ubuntu)
APT (Advanced Packaging Tool) is the package management system used by Debian, Ubuntu, Linux Mint, Pop!_OS, and other Debian-based distributions. It consists of several tools that work together to handle packages:
apt - High-level tool for managing packages
apt-get - Lower level package tool with more options
apt-cache - Query available packages and information
dpkg - Low-level tool to install, remove, and manage .deb packages
To update the package index:
sudo apt update
To install a package:
sudo apt install package_name
To remove a package:
sudo apt remove package_name
To upgrade installed packages:
sudo apt upgrade
APT makes it trivial to install, remove, and update thousands of free applications on Debian-based systems.
2. DNF (RPM-based distros)
DNF (Dandified Yum) is the next-generation version of Yum used by RPM-based distributions like Fedora, CentOS, and RHEL. It manages RPM packages with the following commands:
Update package index:
sudo dnf update
Install a new package:
sudo dnf install package_name
Remove an installed package:
sudo dnf remove package_name
Upgrade packages:
sudo dnf upgrade
DNF improves upon Yum with faster performance and better dependency resolution. It serves as the base package manager for Red Hat-based distros.
3. Pacman (Arch Linux)
Pacman is the lightweight package manager created specifically for Arch Linux. It works with Arch's rolling release model to provide bleeding-edge software packages.
Update package database:
sudo pacman -Sy
Install packages:
sudo pacman -S package_name
Remove packages:
sudo pacman -R package_name
Upgrade system:
sudo pacman -Syu
Pacman keeps the system updated by syncing with the constantly changing Arch repositories. It uses tar to efficiently manage Arch's binary packages.
4. Portage (Gentoo)
Portage is the original source-based package manager created for Gentoo Linux. It compiles applications from source code optimized for your CPU architecture.
Update repository:
sudo emerge --sync
Install package:
sudo emerge package_name
Remove package:
sudo emerge --unmerge package_name
Upgrade system:
sudo emerge -uDN @world
With Portage, you can tune compilation flags and options to build apps specifically for your hardware.
5. Zypper (openSUSE)
Zypper is the package manager used by SUSE and openSUSE Linux. It manages RPM packages with commands like:
Update package index:
sudo zypper refresh
Install new packages:
sudo zypper install package_name
Remove packages:
sudo zypper remove package_name
Upgrade system:
sudo zypper update
Zypper combines robust dependency resolution with ease of use to help SUSE users manage packages.
Conclusion
Linux package managers are what sets distros apart and allow you to get applications installed in one quick command. They help maintain, update, and configure thousands of packages on your system.
Package managers like APT, DNF, Pacman, Portage, and Zypper exemplify the best features of Linux - choose the one that best fits your needs and preferences!
The key differences between package managers include:
Binary packages vs compiling from source - Some distros like Gentoo use source compilation while most are binary-based.
Bleeding edge updates vs stability - Rolling release distros emphasize latest packages while point releases prioritize stability.
Simplicity vs customization - Some package managers focus on ease of use while others allow deep customization.
Evaluating the various packaging systems can help you select the right Linux distribution. The package manager provides the foundation for efficiently managing software.
Subscribe to my newsletter
Read articles from Pratik M directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Pratik M
Pratik M
As an experienced Linux user and no-code app developer, I enjoy using the latest tools to create efficient and innovative small apps. Although coding is my hobby, I still love using AI tools and no-code platforms.