USD ($)
$
United States Dollar
Euro Member Countries
India Rupee
د.إ
United Arab Emirates dirham
ر.س
Saudi Arabia Riyal

System Package Managers

Lesson 25/32 | Study Time: 20 Min

System package managers are fundamental tools in Linux distributions that automate the installation, upgrade, configuration, and removal of software packages.

These tools simplify software management by handling package dependencies, retrieving software from repositories, and maintaining a consistent and secure software environment.

With a package manager, users avoid the complexities of manual installation, such as compiling software from source, and gain the ability to keep systems updated efficiently. 

Core Functions of Package Managers

For system administrators, package managers are essential tools for maintaining stable environments. The key functions listed below support secure updates, clean uninstallation, and repository management.


1. Installation: Automates downloading and installing software packages from configured repositories or local files.

2. Dependency Resolution: Automatically manages dependencies by installing required libraries and packages, ensuring software runs correctly.

3. Upgrade and Update: Provides mechanisms to update installed packages to newer versions with security patches and feature improvements.

4. Removal: Facilitates safe uninstallation of packages and optionally removes orphaned dependencies.

5. Information Retrieval: Allows querying installed packages, searching available software, and viewing package metadata.

6. Repository Management: Handles adding, enabling, or disabling software repositories to extend available software sources.

Popular Linux System Package Managers

Basic Package Manager Commands

Different Linux distributions use different package managers with similar core commands. The key commands below compare how common package management tasks are performed in APT, DNF, and Pacman.


1. Install a Package


  • APT:
text
sudo apt install package_name


  • DNF:
text
sudo dnf install package_name


  • Pacman:
text
sudo pacman -S package_name


2. Remove a Package


  • APT:
text
sudo apt remove package_name


  • DNF:
text
sudo dnf remove package_name


  • Pacman:
text
sudo pacman -Rs package_name


3. Update Package Lists


  • APT:
text
sudo apt update


  • DNF:
text
sudo dnf check-update


  • Pacman:
text
sudo pacman -Sy


4. Upgrade Installed Packages


  • APT:
text
sudo apt upgrade


  • DNF:
text
sudo dnf upgrade


  • Pacman:
text
sudo pacman -Su


5. Search for Packages


  • APT:
text
apt search keyword


  • DNF:
text
dnf search keyword


  • Pacman:
text
pacman -Ss keyword


6. List Installed Packages


  • APT:
text
apt list --installed


  • DNF:
text
dnf list installed


  • Pacman:
text
pacman -Q

Best Practices for Package Management