Hello! Welcome to the first lesson in our new module, "Software and Package Management."
In our previous module, we finished by learning how to customize your personal command-line environment using shell startup scripts. Now, we shift our focus from customizing your user's world to managing the software that runs within it. Your ability to install, update, and remove software efficiently and safely is one of the most critical skills for a Linux administrator.
This lesson addresses the learning outcome: Explain the concept of package dependencies and how package managers resolve them. We'll start by defining what software "packages" and "dependencies" are, explore the problems that arise from them, and then see how modern package managers provide an elegant solution. This foundational knowledge is essential for every practical task you'll perform in this module.
1. What is a Package Manager?
In the early days of Linux, installing software was often a manual process: you would download the source code, compile it on your machine, and copy the resulting files to the correct locations. This was tedious, error-prone, and made it difficult to update or remove software cleanly.
To solve this, Linux distributions created package management systems. A package is an archive containing all the files needed for a piece of software (the application itself, configuration files, documentation, etc.), plus metadata describing what the software is, its version, and what other software it needs to run.
A package manager is the tool that automates the entire lifecycle of software on your system: installation, updates, and removal.
To get a clear overview of this concept, let's start with a short video.
What is a Package Manager? Everything You Need to Know!
The following video from KodeKloud provides a concise introduction to what a package manager is and the core problem it solves.
Watch the video from the beginning until 01:52. Focus on how the package manager automates the process and the introduction of two key terms: repositories and dependencies.
As the video explained, package managers make life easier by handling all the details, but the most important detail they manage is dependencies.
2. Understanding Dependencies
Software programs are rarely self-contained. They are built upon the work of others and rely on shared pieces of code called libraries. For example, a graphics editor application doesn't need to reinvent how to open a JPEG image; it can use a standard library, like libjpeg, that provides this functionality.
In this scenario, we say the graphics editor depends on libjpeg. libjpeg is a dependency. For the editor to work, the correct version of libjpeg must be installed on the system.
This "depends on" relationship forms a chain.

This system of sharing libraries is very efficient. It saves disk space because many applications can use the same library without needing their own copy. It also simplifies security; if a vulnerability is found in a library, you only need to update that one package to secure all applications that depend on it.
However, this system also introduces a significant challenge.
3. The Problem: "Dependency Hell"
What happens when two different applications need different, incompatible versions of the same library? Or what if a package you want to install depends on a library that depends on another, which conflicts with something already on your system?
This complex and often frustrating web of conflicting requirements is colloquially known as "dependency hell." It's a state where you can't install or update a piece of software without breaking something else.
This next video segment explains the pros and cons of the traditional package model, with a specific focus on the dreaded dependency hell.
Linux Packaging Formats explained: Flatpak vs Snaps vs DEB & RPM vs AppImage vs AUR
This clip from The Linux Experiment explains the benefits of shared libraries and then clearly outlines the problem of dependency hell.
Watch from 02:31 to 04:17. Pay attention to the description of how shared libraries work and the example of how installing a package needing a different library version can break your system.
To deepen your understanding, it's helpful to know the different forms this problem can take.
The Wikipedia article on "Dependency hell" provides a formal definition and categorizes the different types of dependency conflicts you might encounter.
Read the introduction and the section titled 'Problems'. This will introduce you to terms like 'Long chains of dependencies', 'Conflicting dependencies', and 'Circular dependencies'.
4. The Solution: How Smart Package Managers Work
The solution to dependency hell is the "smart" package manager. This is what you'll use daily as a Linux administrator. These tools don't just install one package; they analyze its dependencies, compare them to what's already on your system, and calculate a complete "plan" to install or update everything needed, in the correct order, without creating conflicts.
To do this, Linux package management uses a two-layer system:
-
Low-Level Tools (e.g.,
dpkg,rpm): These tools work with individual package files (.debfor Debian/Ubuntu,.rpmfor Red Hat/Fedora). They can install, remove, and query these files, but they do not resolve dependencies. If you try to usedpkgto install a package whose dependencies aren't met, it will simply fail with an error. -
High-Level Tools (e.g.,
apt,dnf/yum): These are the "smart" front-ends. They connect to online repositories (vast archives of pre-compiled software), download metadata that lists all packages and their dependencies, and handle the entire dependency resolution process for you. When you runapt install my-app,aptfigures out all the librariesmy-appneeds and installs them automatically.
This distinction is critical for the CompTIA Linux+ exam.
Package Management (RPM, DEB) test
This article from the Trusted Institute is tailored for the Linux+ exam and clearly explains the two-tier system of package management.
Read the sections 'What is Package Management?' and 'How it Works: The Two Main Families'. Focus on the distinction between the roles of low-level tools (rpm, dpkg) and high-level tools (dnf, apt).
The following diagram provides a perfect visual summary of this high-level vs. low-level architecture across the major Linux families.

Test your understanding!
You are using a CentOS system (which uses the RPM package family). You download a file named cool-app-1.0.rpm from a website. You run the command rpm -ivh cool-app-1.0.rpm, but the installation fails with an error: error: Failed dependencies: libcommon.so.2 is needed by cool-app-1.0-1.el8.x86_64.
- What does this error mean?
- Why did the
rpmcommand not fix the problem automatically? - What command should you have used to install
cool-appfrom the system's official repositories, assuming it was available there?
Show answer
- The error means that the
cool-apppackage requires a library file namedlibcommon.so.2, which is not currently installed on the system. rpmis a low-level tool. It only works with the local package file provided and does not automatically search for, download, or install dependencies from repositories.- You should have used
dnf install cool-app.dnfis the high-level package manager for modern Red Hat family systems (like CentOS) that would automatically findcool-appandlibcommonin the repositories and install both.
Conclusion
You have now learned the fundamental theory behind Linux package management. This "why" is crucial for understanding the "how" that we will practice in the upcoming lessons.
Key Takeaways:
- Software in Linux is distributed in packages, which are managed by package managers.
- Packages often rely on shared libraries, creating dependencies.
- Managing these dependencies manually can lead to dependency hell, where conflicting requirements break the system.
- Modern Linux uses a two-tier system to solve this:
- Low-level tools (
dpkg,rpm) manage individual package files but don't resolve dependencies. - High-level tools (
apt,dnf) connect to repositories to automatically calculate and install all required dependencies.
- Low-level tools (
Preview of the Next Lesson:
Now that you understand that high-level package managers rely on repositories to do their work, the next logical step is to learn about the repositories themselves. In our next lesson, we will cover the learning outcome: "Configure and manage package repositories." You will learn where these repository configurations are stored and how to add or remove software sources for your system.