Now working on our Alma Linux 8 system,
which is based around Red Hat Enterprise Linux 8, we're
going to investigate using YUM or DNF.
Let's go through and take a look. And here we are in the glorious
playground of our Alma Linux 8 system where we're going to dive into
the wonderful world of YUM, or is it DNF?
Well, let's actually go through and solve this conundrum straightaway.
If I do a long listing of the /usr/bin/yum,
we can see that this command is actually a symbolic link through to
dnf‑3. If I do the same thing with the dnf command,
it's just a symbolic link through to dnf‑3. So it doesn't
really matter whether we're using YUM or DNF,
neither of which are commands, they are symbolic links all through to dnf‑3,
but nobody wants to call it dnf‑3, so we're either going to call it DNF or YUM.
The reality is,
it doesn't matter whether you use YUM or DNF, end of. Now, with that solved,
let's move on.
If I go through and list our repositories,
we can do a yum and repolist, and we can see our enabled
repositories. But like many other distributions, there are going to
be disabled repositories as well. And including the option ‑‑all,
we're able to see all of our repositories,
including those which are disabled. Now they live in
/etc/yum.repos.d. Notice it's yum.repos.d, not dnf.
And when we look at this,
we've got a whole load of repo files, and it's these repo
files that define where our repositories are.
They could be based on the internet and normally are,
but could also be on local filesystems. Now to update our metadata,
we have got the yum and makecache subcommand.
So this will update our metadata.
But the reality is, we normally don't need to worry about this because in
RHEL 8, there is a systemd timer unit that will go through and run this on
a periodic basis. So we can see it last ran an hour and a minute ago, and
it's due to run in 49 minutes time. So we can see it's scheduled to run
every couple of hours.
If I go through and install the tree package,
we can see that that will install with our yum install and tree,
but we'll do something a little bit bigger. Let's say our HTTP
daemon, we're going to be able to see that we can install the
dependency packages as well.
This is the same as any other of our packages.
So we're installing 10 or so packages by the look here.
But the nice thing about YUM, if I do a yum remove,
we have remove and not purge,
we can go through and remove httpd, but it also goes through and sees
the dependency packages that are no longer required.
So we're able now to both install and remove the 10
packages. This is a little bit different to what you
would've seen with other distributions.
The final thing to take a look at is the update,
and it is the same as we've seen before.
If I don't want to accept the prompt to update,
yum update ‑y, and then as we can go through and see, it automates the
process, so it's great when we're looking at scripting an update or scripting an install using the ‑y option.