Introduction to Package Managers
Package managers are tools that automate installing, updating, and removing software on Linux systems.
What is a Package Manager?
A package manager:
- Installs software from repositories
- Handles dependencies automatically
- Updates all software at once
- Removes software cleanly
- Verifies package integrity
Package Manager by Distribution
| Distribution | Package Manager | Package Format |
|---|---|---|
| Ubuntu/Debian | apt | .deb |
| Fedora | dnf | .rpm |
| RHEL/CentOS | yum/dnf | .rpm |
| Arch | pacman | .pkg.tar |
| openSUSE | zypper | .rpm |
Common Package Manager Commands
While syntax differs, all package managers do similar things:
| Action | Ubuntu/Debian | Fedora/RHEL |
|---|---|---|
| Update list | apt update | dnf check-update |
| Upgrade all | apt upgrade | dnf upgrade |
| Install | apt install pkg | dnf install pkg |
| Remove | apt remove pkg | dnf remove pkg |
| Search | apt search pkg | dnf search pkg |
| Info | apt show pkg | dnf info pkg |
Repositories
Repositories are servers containing packages:
- Official: Maintained by distribution
- Third-party: Additional software
- PPAs (Ubuntu): Personal Package Archives
# View repositories (Ubuntu)
cat /etc/apt/sources.list
ls /etc/apt/sources.list.d/
Dependencies
When you install a package, the manager automatically installs:
- Dependencies: Required packages
- Recommends: Suggested packages
- Suggests: Optional packages
# See dependencies
apt depends firefox
Package vs Application
- Package: Single component (library, tool, app)
- Application: May require multiple packages
- Metapackage: Group of packages
Example: Installing python3 might install:
- python3-minimal
- python3-lib
- python3-stdlib
Why Use Package Managers?
Without Package Manager
# Manual installation
wget https://site.com/software.tar.gz
tar -xzf software.tar.gz
cd software
./configure
make
make install
# Updating? Repeat everything
# Removing? Hope you remember what was installed where
With Package Manager
# Easy installation
apt install software
# Update everything
apt upgrade
# Clean removal
apt remove software
Package Manager Tips
- Update before installing: Always run update first
- Read what's being installed: Check package list
- Keep system updated: Regular upgrades = security
- Use official repos first: More reliable
- Clean up periodically: Remove unused packages
Other Package Formats
Beyond distribution packages:
| Format | Tool | Cross-platform |
|---|---|---|
| Snap | snap | Yes (Ubuntu focus) |
| Flatpak | flatpak | Yes |
| AppImage | N/A | Yes (self-contained) |
| Docker | docker | Yes (containers) |
Key Takeaways
- Package managers automate software installation
- Different distributions use different managers
- apt for Debian/Ubuntu, dnf/yum for RHEL/Fedora
- Always update package lists before installing
- Dependencies are handled automatically

