[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

[CentOS 8] DNF migration course for those who love Yum

Hello.
I'm Mandai, in charge of Wild on the development team.

A little while ago, CentOS 8 was released.

Beyond Co., Ltd. is generally an MSP company (we also have businesses other than MSP! Please see Beyond's service guide | Beyond Co., Ltd. .

This time, I will talk about how if you use CentOS, you will no longer need the yum command that everyone uses.

yum command will be deprecated

If you are familiar with this, you may be thinking, ``Finally'', but the yum command will be discontinued.
If you are worried about how to manage packages, don't worry.
There is a proper successor package management system in place!

Its successor tool is dnf.

Some of you may not have heard of dnf.
However, let me tell you that it is not a tool that pops out of the box.

dnf is a package management system used in the same Redhat-compatible distribution called Fedora, and has been introduced to CentOS as well.

Why did you change it?
Since yum is based on Python 2, there is a problem that it cannot be used indefinitely.

Since dnf runs on Python 3, the version of Python used by the system in CentOS 8 has also been increased to Python 3.

Immediately after the OS is installed, only the system-use Python called platform-python is installed, so it seems that the Python used by users needs to be installed again.

I wanted to understand the dnf command, so I tried using dnf to use commands that I often use with yum.

I tried using the dnf command to perform a process that is often done in package management.

See list of packages

When searching for a package, I always use yum list | grep [package name].

What happens when you run yum list with dnf?

dnf list

Only the name of yum has changed.

By the way, if you want to see the list of installed packages,

dnf list installed

You can check it.

Install the package

So what if we want to install a package?

What happens when you run yum install using dnf?

dnf install [package name]

Here too, yum has just become dnf.

uninstall the package

It may be time for you to understand this, but what happens when you run yum remove with dnf?

dnf remove [package name]

I've come to understand that the basic usage is not that different!

I want to use the epel repository

What about using the epel repository?

To install the epel repository, install it with the following command:

dnf install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm # or dnf install epel-release

As for the epel.repo file where the repository settings are written, based on the flow up to this point, it seems like there is a directory for dnf under /etc.

ls -al /etc/dnf total 16 drwxr-xr-x. 8 root root 128 Nov 17 05:03 . drwxr-xr-x. 80 root root 8192 Nov 25 01:18 .. drwxr-xr-x. 2 root root 6 May 13 2019 aliases.d -rw-r--r--. 1 root root 82 May 13 2019 dnf.conf drwxr-xr-x. 2 root root 59 Nov 25 01:18 modules.d drwxr-xr- x. 2 root root 6 May 13 2019 modules.defaults.d drwxr-xr-x. 3 root root 89 Nov 17 05:04 plugins drwxr-xr-x. 2 root root 59 Nov 17 05:04 protected.d drwxr- xr-x. 2 root root 37 Nov 17 05:03 vars

yeah? I don't see any directory like repos.d.
That should be it.

Surprisingly, the directory for the repo file is still /etc/yum.repos.d.
It's confusing!

ls -al /etc/yum.repos.d/ total 84 drwxr-xr-x. 2 root root 4096 Nov 17 05:15 . drwxr-xr-x. 80 root root 8192 Nov 25 01:18 .. -rw- r--r--. 1 root root 731 Nov 17 05:15 CentOS-AppStream.repo -rw-r--r--. 1 root root 712 Nov 17 05:15 CentOS-Base.repo -rw-r- -r--. 1 root root 798 Nov 17 05:15 CentOS-centosplus.repo -rw-r--r--. 1 root root 1357 Nov 17 05:08 CentOS-CR.repo -rw-r--r --. 1 root root 668 Aug 14 06:42 CentOS-Debuginfo.repo -rw-r--r--. 1 root root 756 Nov 17 05:15 CentOS-Extras.repo -rw-r--r-- . 1 root root 356 Nov 17 05:08 CentOS-fasttrack.repo -rw-r--r--. 1 root root 976 Nov 17 05:08 CentOS-Media.repo -rw-r--r--. 1 root root 736 Nov 17 05:15 CentOS-PowerTools.repo -rw-r--r--. 1 root root 1382 Aug 14 06:42 CentOS-Sources.repo -rw-r--r--. 1 root root 78 Nov 17 05:08 CentOS-Vault.repo -rw-r--r--. 1 root root 1400 Nov 17 05:08 epel-playground.repo -rw-r--r--. 1 root root 1249 Oct 10 16:15 epel-playground.repo.rpmnew -rw-r--r--. 1 root root 1206 Nov 17 05:15 epel.repo -rw-r--r--. 1 root root 1104 Oct 10 16 :15 epel.repo.rpmnew -rw-r--r--. 1 root root 1354 Nov 17 05:08 epel-testing.repo -rw-r--r--. 1 root root 1203 Oct 10 16:15 epel-testing.repo.rpmnew

I was able to find the repo file.

The contents of the file appear to be the same as before.

By the way, when specifying enable/disable of a repository using a command, the usage of --enablerepo / --disablerepo options seems to be the same as with yum.

The remi repository that PHPer loves (or so I think) can be installed with the following command after installing the epel repository.

dnf install https://rpms.remirepo.net/enterprise/remi-release-8.rpm

As written on the remi repository site, it seems that the installation method is slightly different from yum.

The concept of modules has been added to dnf, and just by specifying PHP, basic packages such as php-cli, php-common, php-fpm, php-json, php-mbstring, and php-xml are installed. .

It's a natural thing for those of us who live in multi-byte areas, but it's a little surprising that php-mbstring is now installed by default.

The benefit of introducing this module is that it has become easier to replace multiple versions of packages.

dnf module reset php:remi-7.3 dnf module install php:remi-7.2

If you do this, the version will change quickly.
You probably don't use it on a daily basis, but knowing it may come in handy when you're in a pinch.

Also, the PHP version registered in the CentOS8 AppStream repository has been updated to 7.2, so it doesn't seem like it will be used that often.

However, security updates for PHP7.2 are not until the end of November 2020, so there are some circumstances that prevent it from being used for a long time.

summary

This time, we introduced a package management tool called dnf that was first installed in CentOS 8.

My impression is generally the same as yum, and I would be happy if I could lower the psychological barrier of everyone who reads it.

I remember the horror I felt when systemd came to CentOS 7, but dnf is nice and easy to get started with.

One final note: yum is not going away anytime soon; the yum command is still alive and well on CentOS 8.

However, yum in CentOS 8 is like a wrapper command for dnf, and even within /usr/bin/yum it only processes keyboard input and calls dnf modules.

Since this is already the case, there is no doubt that the yum command will disappear in the near future.
At that time, I would like to write an article remembering the package management systems that have disappeared from this world.

That's it.

If you found this article helpful , please give it a like!
2
Loading...
2 votes, average: 1.00 / 12
69,424
X facebook Hatena Bookmark pocket
[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

The person who wrote this article

About the author

Yoichi Bandai

My main job is developing web APIs for social games, but I'm also fortunate to be able to do a lot of other work, including marketing.
Furthermore, my portrait rights in Beyond are treated as CC0 by him.