Package Managers Introduction
Installing software on Linux isn't like Windows where you download .exe files from random websites. Linux has package managers - centralized systems that handle everything.
The Problem with Manual Installation
Imagine installing software manually:
- Find the download link
- Download the file
- Extract it
- Figure out dependencies
- Install dependencies first
- Then install your software
- Hope nothing breaks
Now multiply that by 50 programs. And updates? Forget it.
Package Managers Solve Everything
A package manager:
- Downloads software from trusted repositories
- Handles all dependencies automatically
- Updates everything with one command
- Removes software cleanly
- Verifies package integrity
One command. Dependencies handled. Done.
Different Distros, Different Managers
| Distribution | Package Manager | Package Format |
|---|---|---|
| Ubuntu/Debian | apt | .deb |
| Fedora/RHEL | dnf | .rpm |
| CentOS (older) | yum | .rpm |
| Arch Linux | pacman | .pkg.tar |
| Alpine | apk | .apk |
| openSUSE | zypper | .rpm |
Same Concepts, Different Commands
They all do the same things: install, remove, update, search. The commands differ slightly, but once you know one, learning others is easy.
Quick Cross-Reference
| Action | apt (Debian/Ubuntu) | dnf (Fedora/RHEL) | pacman (Arch) |
|---|---|---|---|
| Install | apt install pkg | dnf install pkg | pacman -S pkg |
| Remove | apt remove pkg | dnf remove pkg | pacman -R pkg |
| Update list | apt update | dnf check-update | pacman -Sy |
| Upgrade all | apt upgrade | dnf upgrade | pacman -Syu |
| Search | apt search pkg | dnf search pkg | pacman -Ss pkg |
RHCSA Note
If you're preparing for RHCSA certification, focus on dnf (and legacy yum). Enterprise Linux (RHEL, CentOS, Rocky) uses RPM packages.
How Packages Work
A package is a compressed archive containing:
- The software itself (binaries)
- Configuration files
- Documentation
- Metadata (dependencies, version, description)
- Installation scripts
Repositories - Where Packages Live
Packages come from repositories (repos) - servers that host thousands of packages:
- main: Officially supported software
- universe: Community-maintained
- restricted: Proprietary drivers
- multiverse: Software with legal restrictions
Stick to Official Repos
Official repositories are tested and secure. Random PPAs and third-party repos? Use with caution.
What does a package manager NOT do?
Key Takeaways
- Package managers centralize software installation
- They handle dependencies automatically
- Different distros use different managers (apt, dnf, pacman)
- Packages come from repositories
- One command to install, one to update
Next: mastering apt commands on Debian/Ubuntu.