How To Install systemd-networkd on CentOS 8

systemd-networkd is System daemon that manages network configurations

Introduction

In this tutorial we learn how to install systemd-networkd on CentOS 8.

What is systemd-networkd

systemd-networkd is a system service that manages networks. It detects and configures network devices as they appear, as well as creating virtual network devices.

We can use yum or dnf to install systemd-networkd on CentOS 8. In this tutorial we discuss both methods but you only need to choose one of method to install systemd-networkd.

Install systemd-networkd on CentOS 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install systemd-networkd using dnf by running the following command:

sudo dnf -y install systemd-networkd

Install systemd-networkd on CentOS 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

The output should look something like this:

CentOS Linux 8 - AppStream                                       43 kB/s | 4.3 kB     00:00    
CentOS Linux 8 - BaseOS                                          65 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - ContinuousRelease                               43 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - Extras                                          23 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - FastTrack                                       40 kB/s | 3.0 kB     00:00    
CentOS Linux 8 - HighAvailability                                36 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - Plus                                            24 kB/s | 1.5 kB     00:00    
CentOS Linux 8 - PowerTools                                      50 kB/s | 4.3 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64           13 kB/s | 9.2 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                   24 kB/s | 8.5 kB     00:00    
Metadata cache created.

After updating yum database, We can install systemd-networkd using yum by running the following command:

sudo yum -y install systemd-networkd

How To Uninstall systemd-networkd on CentOS 8

To uninstall only the systemd-networkd package we can use the following command:

sudo dnf remove systemd-networkd

systemd-networkd Package Contents on CentOS 8

/etc/systemd/network
/etc/systemd/networkd.conf
/usr/bin/networkctl
/usr/lib/.build-id
/usr/lib/.build-id/4d
/usr/lib/.build-id/4d/b50f36f2f67d131ab16f10586c29eb2741c0d4
/usr/lib/.build-id/5a
/usr/lib/.build-id/5a/3e191daa8e9860f93c0c7dd69270c72f3b2c61
/usr/lib/.build-id/6c
/usr/lib/.build-id/6c/82f66aecbb1a0e988d29f7409a5d2ca6dc2027
/usr/lib/.build-id/df
/usr/lib/.build-id/df/56052dc87d10e6b964674b2372853f540c6da7
/usr/lib/systemd/network
/usr/lib/systemd/network/80-container-host0.network
/usr/lib/systemd/network/80-container-ve.network
/usr/lib/systemd/network/80-container-vz.network
/usr/lib/systemd/network/80-vm-vt.network
/usr/lib/systemd/network/80-wifi-adhoc.network
/usr/lib/systemd/network/80-wifi-ap.network.example
/usr/lib/systemd/network/80-wifi-station.network.example
/usr/lib/systemd/system/systemd-network-generator.service
/usr/lib/systemd/system/systemd-networkd-wait-online.service
/usr/lib/systemd/system/systemd-networkd.service
/usr/lib/systemd/system/systemd-networkd.socket
/usr/lib/systemd/systemd-network-generator
/usr/lib/systemd/systemd-networkd
/usr/lib/systemd/systemd-networkd-wait-online
/usr/share/bash-completion/completions/networkctl
/usr/share/dbus-1/system-services/org.freedesktop.network1.service
/usr/share/dbus-1/system.d/org.freedesktop.network1.conf
/usr/share/licenses/systemd-networkd
/usr/share/licenses/systemd-networkd/LICENSE.LGPL2.1
/usr/share/man/man1/networkctl.1.gz
/usr/share/man/man5/networkd.conf.5.gz
/usr/share/man/man5/networkd.conf.d.5.gz
/usr/share/man/man5/systemd.netdev.5.gz
/usr/share/man/man5/systemd.network.5.gz
/usr/share/man/man8/systemd-network-generator.8.gz
/usr/share/man/man8/systemd-network-generator.service.8.gz
/usr/share/man/man8/systemd-networkd-wait-online.8.gz
/usr/share/man/man8/systemd-networkd-wait-online.service.8.gz
/usr/share/man/man8/systemd-networkd.8.gz
/usr/share/man/man8/systemd-networkd.service.8.gz
/usr/share/polkit-1/actions/org.freedesktop.network1.policy
/usr/share/polkit-1/rules.d/systemd-networkd.rules
/usr/share/zsh/site-functions/_networkctl

References

Summary

In this tutorial we learn how to install systemd-networkd on CentOS 8 using yum and dnf.