In this video, we'll explore Yum DNF on Red Hat.
So how does it work? Well, Yum is used in older versions of Red Hat and Family.
Recently the Yum backend has been replaced with dnf.
DNF is a preferred tool in current RHEL versions, and with the release of RHEL 10, a new
version of DNF has been introduced which is no longer backward compatible to the older versions of Yum.
So where in RHEL 9 and related you could use Yum if you wanted
to. In RHEL 10 and related, it really becomes important to use DNF.
DNF uses repositories that are in etc Yum Repos D
and the DNF command was written to be intuitive.
You use commands like dnf install, dnf search, and dnfremove. That kind of speaks for itself in
dnf. You can also work with package groups and that makes installation of specific functionality easier.
Use DNF groups list for an overview and DNF groups install to install a specific group.
While working with dnf, finding the right package may be a challenge, but there's DNF provides to fix that.
Use DNF provides SELinux to look for packages that contain a file with the name selinux and replace
that with any file name if you are looking for a package that contains a specific file.
And also the dnf history command is convenient to undo changes after installing packages.
Let me demonstrate how to work with dnf.
So first some basics. Sudo dnf certs zsh Some
people like zsh. It's a powerful interactive shell.
So if you think you like that, then you can use sudo dnf install zsh.
Then you need to press yes to install it. You can also use dnf install y.
Then it doesn't wait for you to confirm that you really want to install. But I
like having an overview so that you know that it's going in the right direction.
I also like DNF list.
So DNF list SELinux, for instance, is listing all
packages that have a name starting with Selinux.
And what do we have here? Well, we have a list
of installed packages and maybe even more interesting available packages.
And these available packages are packages that, well, have not been installed.
And you know why this is convenient? Sometimes you think, oh, I need
this functionality that relates to whatever Selinux in this case maybe HTTP.
Then you use DNF list SELinux or HTTP and you see all the packages
starting with and in many cases that is quite as powerful as DNF certs.
Now let me use a sudo DNF update which is doing what?
Well, that is going to check if any updates are available and oh boy, I can see many updates
are available. Do I want to install that right now? No, I don't. So let's get out of here.
I'm going to do that at a later time. Maybe this is something that I want to schedule in a cron job.
In DNF we also have DNF groups. So sudo
DNF groups list is showing all the DNF groups.
And if you want to implement specific functionality, you can do that by installing the entire group.
Like sudo DNF groups installed container.
Container management.
Do you think this is going to be all right? No, it's not, because there's space in the group name
and in Linux if there is spaces, that can lead to interpretation problems. So just to make sure, put everything
between double quotes and that will install all the packages in that specific group. And is that okay?
Yeah, that is okay.
Oh, and look at that. I didn't even see it. It didn't install. It upgraded.
So in the group we had two packages, Podman and Builder. And apparently a
newer version was available and now I have access to the newer version.
Last thing I want to show you is sudo DNF repo list which is listing the repositories on your system.
And behind these repositories there is configuration. Let me show you. Etc. Yum.
Repos D CentOS Repo.
That's a CentOS repository that was provided while I installed the CentOS system.
We don't care about the details too much, it's just working. You may notice that every
now and then if you want to install additional software, you need access to additional repositories.
That's specifically happening when you work with software that is provided by some external vendors.