From the course: Complete Guide to Linux Security: Protecting Your Linux Server Environment
Updating Fedora, Red Hat, and CentOS - Linux Tutorial
From the course: Complete Guide to Linux Security: Protecting Your Linux Server Environment
Updating Fedora, Red Hat, and CentOS
- Now let's move to the other side of the aisle and talk about updating Fedora and Red Hat and CentOS. If you look at the slide here, you'll see that the main package manager for these is dnf. That stands for Dandified YUM, and that is the update to the older YUM Package Manager. Now, when you work with Fedora and Red Hat and CentOS, you're dealing with .rpms. Those are the main packages that you're installing, and we use dnf as the package manager to install those. Now, the dnf command has several options. You could do a full dnf update, which means it'll look for and download everything and install everything that can be updated, or you could do a dnf update--downloadonly. So, it'll look for all the updates that are available and just download them without installing them, or a dnf check-update, which will just check and make a list of potential updates for your system. Then, for these two options, you have two ways to go. You can do a full dnf update, and that'll update everything on the system, or you can install individual packages with dnf install <packagename>, and that also goes for updating individual packages. So, dnf works a little bit differently than apt. With apt, on Debian Systems, you have the apt updates, and then the actual install or upgrade happens with apt upgrade. But here, we just have dnf update. That is it. So, let's go ahead and show some of this on our CentOS system. So, I'm connected to CentOS 9 Stream, and I'm logged in as root. Let's go ahead and do a dnf check-update now, and check for updates from all of the repositories for this system. Okay, that didn't take too long, and it shows all the possible updates for this system, including network manager updates, glibraryc, we have kernel updates, openldap, python, selinux, and so on. A lot of these are fairly important, so this is the kind of thing that I would definitely check for, and then update the ones that I need, or just do a full dnf update. Again, if we only want certain ones, we could do dnf install and then the package name. So, perhaps I want NetworkManager, and the rest of the name there .x86_64. I could just grab that one, or we could do a dnf update--downloadonly, and that'll give us the downloads, and then we could pick and choose and update what we want, or perhaps we could make an update repository of our own that could be pushed out to all of our other CentOS servers. There's a lot of options with that. So, remember, when working with Fedora, Red Hat, CentOS, you're normally going to be using dnf. Sometimes you might use the older YUM Package Manager, and you have your variety of options here where you could do full update, or just download updates, or just check for those updates. And again, you could do a full update, or install by package name. And that's it for this sub-lesson.