Let's talk about software managers or package managers.
These software managers were developed to fix the dependency problems.
Before the software manager. You could have a real dependency. Hell, you know how that works. You wanted
to install an application using RPM IVA on your application, and then it would complain about missing dependencies.
You would want to try to install your dependencies, which on their turn might have dependencies themselves as
well. And the result is that you could easily spend an entire afternoon on getting something to work.
Software managers have the solution, and they do so by working with repositories.
Repositories are online resources where packages are stored, many of
them, so that dependency requirements can automatically be solved.
Before installing a package, the software manager analyzes the dependencies and
it will try to fetch the dependencies from the repositories.
Repositories themselves are provided by the Linux distribution or by
software vendors, or you might even create your own.
Some commonly used software managers are Yum or DNF on Red Hat and Family, and apps on Ubuntu and Related.
Before I'm going to show you how that works, let's do a quick whiteboard
drawing so that I can explain the relation between repositories, software managers and packages.
All right, let's talk about software managers. To understand software managers, we need to. Start talking about the repository.
The repository is normally an online resource, and in this online resource you find two things.
You find packages, RPM packages on Red Hat Family, Debian packages
on Ubuntu and Related, and you will find an index.
And this index is continuously updated as new packages are added to the repository.
Then on your local system, you have the repository client. Let's say that this
client is dnf, but what I'm telling you goes for APT as well.
It's different command, but the mechanism is the same.
So you want to install packages using dnf. In order to do
so, DNF needs to get the latest version of the index.
You may have noticed that when you work with packages on the Internet, sometimes it's a little
bit slow. That is because it's always checking if the index has changed, and if it has
changed, it will download it. Because DNF needs to know if any updates are available.
If this index is locally available, it can be compared to the packages that you have right here.
Then you are going to install your packages. Let's say your package name is MyApp.
Then the package is going to be analyzed for dependencies.
And if dependencies are required, well, then the dependencies are automatically fetched. From the
repository as well, and that makes the repository the solution for the dependency problem.
But we are not done.
Once these packages are installed, they are also registered in a local database.
In the case of rpm, that would be the RPM database.
So this RPM database is a local database that you can query to figure out what exactly is installed on your system.
And when you use DNF to install any package, well, the index will be compared with
the packages locally in your database and that makes it your software manager also knows if
updates are required and it will be able to install these updates as well.