Package Management (apt, yum, pacman)
Understand the basics of installing, updating, and removing software packages on different Linux distributions.
Package Management (apt, yum, pacman) is a free DevOps Bootcamp lesson on CoddyKit — lesson 3 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the DevOps Bootcamp learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
What are Package Managers?
Imagine installing software on your computer. You'd need to find the right files, put them in the correct folders, and resolve any dependencies (other software it needs to run).
This can be a headache! That's where package managers come in. They automate this entire process, making software installation, updates, and removal super easy.
- Packages: Bundled software, often with dependencies.
- Manager: Handles installation, updates, and removal.
Meet APT: Debian/Ubuntu
One of the most widely used package managers is APT (Advanced Package Tool). You'll find it on Debian-based Linux distributions like Ubuntu, Linux Mint, and Pop!_OS.
APT works with .deb package files and simplifies managing software from official repositories.
Updating Package Lists with APT
Before installing new software, it's crucial to update your local list of available packages. This tells APT what's new and where to find it.
Use sudo apt update. This command doesn't upgrade your installed software; it only refreshes the package index.
sudo apt updateInstalling Software with APT
To install a new package, you use apt install followed by the package name. You'll often need sudo for administrative privileges.
Let's install neofetch, a tool that displays system information.
sudo apt install neofetchUninstalling with APT
If you no longer need a package, you can remove it. There are two main ways:
sudo apt remove [package]: Removes the package, but keeps its configuration files.sudo apt purge [package]: Removes the package and all its configuration files.
Let's remove neofetch using remove first.
sudo apt remove neofetchYUM & DNF: Red Hat Family
For Red Hat-based distributions like CentOS, Fedora (older versions), and Red Hat Enterprise Linux (RHEL), YUM (Yellowdog Updater, Modified) was the primary package manager.
Today, DNF (Dandified YUM) is its modern successor, offering better performance and dependency resolution. Commands are often quite similar.
Basic YUM/DNF Commands
YUM and DNF commands are intuitive and often mirror APT's logic. To check for updates or install a package, you'd use similar syntax.
Here's how to check for updates and install htop (an interactive process viewer) using YUM.
sudo yum check-update
sudo yum install htopPacman: Arch Linux's Manager
Arch Linux and its derivatives (like Manjaro) use Pacman (Package Manager). It's known for its simplicity, speed, and powerful features.
Pacman uses a slightly different command syntax, often involving single-letter flags with a hyphen.
Installing & Removing with Pacman
With Pacman, -S is used for syncing and installing packages, and -R for removing them. You'll typically need sudo.
Let's install and then remove cmatrix, a fun terminal animation program.
sudo pacman -S cmatrix
sudo pacman -R cmatrixWhy So Many Managers?
You might wonder why there are different package managers. It's because different Linux distributions are built on different foundations and use distinct package formats:
- Debian/Ubuntu: Uses
.debpackages, managed by APT. - Red Hat/CentOS: Uses
.rpmpackages, managed by YUM/DNF. - Arch Linux: Uses
.pkg.tar.xzpackages, managed by Pacman.
Each system is optimized for its distribution's design.
Package Manager Quiz
Which command is used to install the nginx web server on an Ubuntu system?
Recap: Package Managers
You've now learned about the essential role of package managers in Linux!
- They automate software installation, updates, and removal.
- APT is used for Debian/Ubuntu (
sudo apt update,sudo apt install). - YUM/DNF are for Red Hat/CentOS (
sudo yum install,sudo dnf update). - Pacman is for Arch Linux (
sudo pacman -S,sudo pacman -R).
Mastering these tools is fundamental for any Linux user!
Frequently asked questions
Is the “Package Management (apt, yum, pacman)” lesson free?
Yes — the full text of “Package Management (apt, yum, pacman)” is free to read here on the web, and the DevOps Bootcamp course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the DevOps Bootcamp course, upgrade to CoddyKit PRO.
What will I learn in “Package Management (apt, yum, pacman)”?
Understand the basics of installing, updating, and removing software packages on different Linux distributions. You practise DevOps Bootcamp with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start DevOps Bootcamp?
No prior experience is required. DevOps Bootcamp on CoddyKit is structured for beginners through advanced learners; this is — lesson 3 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Package Management (apt, yum, pacman)” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this DevOps Bootcamp lesson?
Yes. Every DevOps Bootcamp lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Managing Environment Variables (export, unset)
- Shell Startup Files (.bashrc, .profile)
- Package Management (apt, yum, pacman)
- Understanding and Customizing the PATH Variable