The default package manager for CentOS 8 has migrated from yum to dnf. Find out how this tool is used.
CentOS 8 has been released and it comes with a number of important changes, changes that will directly affect how you manage those Linux servers in your data center. One of the more immediate changes is how you install applications from the command line.
Prior to the eighth iteration, CentOS used the yum package manager. As of CentOS 8, package management has migrated from yum to Dandified Yum (DNF). How that works, I cannot figure out--maybe they should have named it DNY or DFY. DNF was introduced way back in Fedora 18 and became the default package manager in Fedora 22, so it's taken a while to make its way to the server OS.
But here it is, and you'll need to know how to use it. Fortunately, it's very similar to yum. Let's find out how similar.
SEE: CentOS: A how-to guide (free PDF) (TechRepublic)
Basic use of DNF
In its simplest form, installing a package with DNF looks like this:
sudo dnf install PACKAGE
Where PACKAGE is the name of the package to be installed.
To remove a package, the command is:
sudo dnf remove PACKAGE
Where PACKAGE is the name of the package to be removed.
To update software on your system, issue the command:
sudo dnf update
This will run all available updates on your system. To upgrade a specific package, you can issue the command:
sudo dnf update PACKAGE
Where PACKAGE is the name of the package to be updated.
SEE: Hiring kit: Database administrator (TechRepublic Premium)
How to use group install with DNF
DNF has a pretty cool trick up its sleeve, called group install. With group install, you can use a single command to install all packages related to a group. To see a list of all available groups, issue the command:
sudo dnf group list
For instance, if you want to install the Network Servers package (which includes the likes of dhcp-server, dnsmasq, krb5-server, libreswan, radvd, rsyslog-gnutls, syslinux, tftp-server), issue the command:
sudo dnf group install "Network Server"
Note that the group list command doesn't show a number of hidden groups. To view the installable hidden groups, issue the command:
dnf grouplist hidden
From that list, you can then install one of the hidden groups in the same manner you installed the visible groups.
And that's the gist of using the DNF package manager found in CentOS 8. You shouldn't have any problems migrating from yum, as they are quite similar. Fortunately, for those that have trouble with change, the yum package manager remains intact, for now. However, I do suggest that you migrate to DNF, as yum probably won't remain for long (as it has been deprecated).
- How to become a database administrator: A cheat sheet (TechRepublic)
- 10 things companies are keeping in their own data centers (TechRepublic download)
- A better way to install Docker on CentOS 8 (TechRepublic)
- How to enable automatic updates with Cockpit on CentOS 8 (TechRepublic)
- How to enable SSH session recording in CentOS 8 (TechRepublic)
- How to enable Cockpit on CentOS 8 (TechRepublic)
- Red Hat's CentOS 8 arrives: Here's what you get with it (ZDNet)
- Best cloud services for small businesses (CNET)
- DevOps: More must-read coverage (TechRepublic on Flipboard)