APT and YUM Package Managers
Explore the differences and commonalities between Debian-based (APT) and Red Hat-based (YUM/DNF) package management systems.
APT and YUM Package Managers is a free Linux Server Deployment & SSH Mastery lesson on CoddyKit — lesson 1 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 Linux Server Deployment & SSH Mastery 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 without a dedicated app store. You'd have to find the software, download it, deal with its dependencies (other software it needs), and then install it manually. It's a hassle!
Package managers are tools that automate this process for Linux. They streamline installing, updating, and removing software, handling all dependencies for you.
APT: Debian & Ubuntu's Tool
On Debian-based systems like Ubuntu, Linux Mint, and Kali Linux, the primary package manager is APT (Advanced Package Tool).
APT simplifies software management by interacting with a database of available packages and their dependencies, usually stored in remote repositories.
APT: Updating Package Lists
Before installing new software or updating existing ones, it's crucial to update your local package list. This doesn't update your software, but rather refreshes the list of available packages and their versions from the repositories.
Use sudo apt update to do this.
sudo apt updateAPT: Installing Software
Once your package lists are updated, you can easily install new software. For example, to install the htop utility (a process viewer), you'd use the apt install command.
The sudo prefix is often needed for system-wide changes.
sudo apt install htopAPT: Removing Software
To remove a package, you have two main options:
apt remove [package_name]: Removes the package, but keeps its configuration files.apt purge [package_name]: Removes the package AND its configuration files. This is useful for a clean removal.
sudo apt remove htopYUM & DNF: Red Hat's Approach
For Red Hat-based distributions like CentOS, Fedora, and RHEL, the package managers are YUM (Yellowdog Updater, Modified) and its modern successor, DNF (Dandified YUM).
DNF offers better performance and dependency resolution compared to YUM, but their command syntax is very similar.
YUM/DNF: Updating Package Lists
Similar to APT, you should check for updates before installing or upgrading. With DNF, you can use dnf check-update to see what packages have updates available.
To apply all updates, you would use sudo dnf update.
sudo dnf check-updateYUM/DNF: Installing Software
Installing software with DNF is straightforward. Just like APT, you use the install subcommand followed by the package name. Let's install htop again as an example.
sudo dnf install htopYUM/DNF: Removing Software
To remove a package using DNF, you use the remove subcommand. DNF will automatically handle removing any dependencies that are no longer needed by other installed software.
sudo dnf remove htopPackage Manager Challenge
You need to install the nginx web server on an Ubuntu machine and httpd (Apache) on a Fedora server. Which commands would you use?
Recap: APT & YUM/DNF
You've now got a solid introduction to the two major package management systems in Linux!
- Package Managers simplify software installation, updates, and removal.
- APT is used on Debian-based systems (Ubuntu, Mint). Key commands:
apt update,apt install,apt remove. - YUM/DNF are used on Red Hat-based systems (CentOS, Fedora). Key commands:
dnf check-update,dnf install,dnf remove.
These tools are fundamental for managing software on your Linux servers.
Frequently asked questions
Is the “APT and YUM Package Managers” lesson free?
Yes — the full text of “APT and YUM Package Managers” is free to read here on the web, and the Linux Server Deployment & SSH Mastery 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 Linux Server Deployment & SSH Mastery course, upgrade to CoddyKit PRO.
What will I learn in “APT and YUM Package Managers”?
Explore the differences and commonalities between Debian-based (APT) and Red Hat-based (YUM/DNF) package management systems. You practise Linux Server Deployment & SSH Mastery 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 Linux Server Deployment & SSH Mastery?
No prior experience is required. Linux Server Deployment & SSH Mastery on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “APT and YUM Package Managers” 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 Linux Server Deployment & SSH Mastery lesson?
Yes. Every Linux Server Deployment & SSH Mastery 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
- APT and YUM Package Managers
- Installing and Updating Software
- Managing Software Repositories
- Building from Source and Using Snap/Flatpak