Okay, so now that we have repository access enabled, let's talk about managing packages
with DNF.
So DNF was created to be intuitive.
So DNF list, for instance, list installed and available packages.
What I like a lot is a command like DNF list SE Linux star, which will show you all packages
that have a name starting with SE Linux and will give you the current status as well.
So if you remember, hey, I need to install additional packages, but you are not sure
about which package exactly, this can be really helpful.
DNF search is convenient as well.
It searches in the name and the summary of the package.
And DNF search all will search in the description as well.
Try for instance DNF search SE info and DNF search all SE info.
I also like DNF provides, which searches in package file list for the package that
provides a specific file.
That is particularly useful if you want to install a package that has a file that is
not an executable.
Use DNF provides star slash container file, for instance, and you will see a list of all
packages that have a file with the name container file.
And DNF info is showing information about these packages.
Let me show you all of this.
So you can start by using DNF search.
Let's use DNF search SE info.
And that is giving nothing.
Do notice, by the way, that you get complaints updating subscription manager and this system
is not registered with an entitlement server.
That is because we are not using subscription manager.
Get used to the error message.
It's not important.
The important thing here is no matches found.
Now let me use DNF search all SE info and see if that is giving a difference.
And there we can see, yeah, that there is a difference and we see a list of packages.
I also like DNF provides, DNF provides star slash.
You need to indicate the pattern followed by container file, for instance.
And there we can see a list of all the packages that have a file with the name container file.
If ever you need an example of a container file, this might be useful.
So apparently we need the builder test package to be installed.
Now if you want more information, then you use DNF info.
DNF info Nmap, for instance, is giving me what?
Is giving me some metadata about the Nmap package, including information about what exactly it is.
And oh, let's not forget DNF list SE Linux star.
That's one of my personal favorites.
You can see that it is showing installed packages, but it's also showing available packages.
And that is so useful, for instance, if you forgot the name of the package that has the SE Linux documentation.
More about SE Linux later, but you are certainly going to like this DNF list option.
Let's see what else is on the slides.
Now once you have found your package, as I told you, it's intuitive.
Use DNF install to install packages, as well as any dependencies.
That is what is so nice about DNF.
It installs dependencies as well.
DNF remove will remove the packages, as well as the packages, depending on this package, which is potentially dangerous.
So what does that mean?
Well, let's say you install package B, and package B has a dependency to package A.
And then you use DNF remove package A.
You'll probably get a warning, but if you use the force option to remove it anyway, you break package B.
So be very careful when you use DNF remove, and don't remove anything if you get warnings.
That you will break dependencies.
DNF update compares current package version with the package version listed in the repository.
And it updates if necessary.
And there's a special case for DNF update on the kernel.
That will install the new kernel and keep the old kernel as a backup.
In case you ever need to boot back in your old kernel, well, you can, after using DNF update on your kernel.
We have already seen DNF install, so let's just jump to the next video, where you will learn about DNF groups.