How To Install systemd-container on Rocky Linux 8

In this tutorial we learn how to install systemd-container on Rocky Linux 8. systemd-container is Tools for containers and VMs

Introduction

In this tutorial we learn how to install systemd-container on Rocky Linux 8.

What is systemd-container

Systemd tools to spawn and manage containers and virtual machines. This package contains systemd-nspawn, machinectl, systemd-machined, and systemd-importd.

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

Install systemd-container on Rocky Linux 8 Using dnf

Update yum database with dnf using the following command.

sudo dnf makecache --refresh

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

sudo dnf -y install systemd-container

Install systemd-container on Rocky Linux 8 Using yum

Update yum database with yum using the following command.

sudo yum makecache --refresh

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

sudo yum -y install systemd-container

How To Uninstall systemd-container on Rocky Linux 8

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

sudo dnf remove systemd-container

systemd-container Package Contents on Rocky Linux 8

/usr/bin/machinectl
/usr/bin/systemd-nspawn
/usr/lib/.build-id
/usr/lib/.build-id/01
/usr/lib/.build-id/01/6b81ac71c01e6fd5cb457b2700036a9237df41
/usr/lib/.build-id/17
/usr/lib/.build-id/17/cd80650eb97351996aa48b5105b01d28ae3442
/usr/lib/.build-id/19
/usr/lib/.build-id/19/a7e6928b51730fe18319f8df78886ede837840
/usr/lib/.build-id/5e/354ec84737b2c747dc8337e50f65c6ff562f29
/usr/lib/.build-id/98
/usr/lib/.build-id/98/b3de5011ab6872f8bb73e484a350355a308cc4
/usr/lib/.build-id/9b
/usr/lib/.build-id/9b/d87d884912e2b4d6c89701f52767a154ab444b
/usr/lib/.build-id/e0/a26a3aa6e2f8ab2c8adfd82b245e7f780e889c
/usr/lib/libnss_mymachines.so.2
/usr/lib/systemd/import-pubring.gpg
/usr/lib/systemd/system/dbus-org.freedesktop.import1.service
/usr/lib/systemd/system/dbus-org.freedesktop.machine1.service
/usr/lib/systemd/system/machine.slice
/usr/lib/systemd/system/machines.target
/usr/lib/systemd/system/machines.target.wants
/usr/lib/systemd/system/machines.target.wants/var-lib-machines.mount
/usr/lib/systemd/system/remote-fs.target.wants/var-lib-machines.mount
/usr/lib/systemd/system/systemd-importd.service
/usr/lib/systemd/system/systemd-machined.service
/usr/lib/systemd/system/[email protected]
/usr/lib/systemd/system/var-lib-machines.mount
/usr/lib/systemd/systemd-import
/usr/lib/systemd/systemd-importd
/usr/lib/systemd/systemd-machined
/usr/lib/systemd/systemd-pull
/usr/lib/tmpfiles.d/systemd-nspawn.conf
/usr/share/bash-completion/completions/machinectl
/usr/share/bash-completion/completions/systemd-nspawn
/usr/share/dbus-1/system-services/org.freedesktop.import1.service
/usr/share/dbus-1/system-services/org.freedesktop.machine1.service
/usr/share/dbus-1/system.d/org.freedesktop.import1.conf
/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf
/usr/share/man/man1/machinectl.1.gz
/usr/share/man/man1/systemd-nspawn.1.gz
/usr/share/man/man8/libnss_mymachines.so.2.8.gz
/usr/share/man/man8/nss-mymachines.8.gz
/usr/share/man/man8/systemd-importd.8.gz
/usr/share/man/man8/systemd-importd.service.8.gz
/usr/share/man/man8/systemd-machined.8.gz
/usr/share/man/man8/systemd-machined.service.8.gz
/usr/share/polkit-1/actions/org.freedesktop.import1.policy
/usr/share/polkit-1/actions/org.freedesktop.machine1.policy
/usr/share/zsh/site-functions/_machinectl
/usr/share/zsh/site-functions/_systemd-nspawn
/usr/bin/machinectl
/usr/bin/systemd-nspawn
/usr/lib/.build-id
/usr/lib/.build-id/0c/d1f7871e856553db2da03dcaa879e3ef0f1ecf
/usr/lib/.build-id/20
/usr/lib/.build-id/20/f11951f0d4c48c0bf0f8a34f5858b2a9dc00d2
/usr/lib/.build-id/4b
/usr/lib/.build-id/4b/467f759288a58874887eedcf9c39861074026e
/usr/lib/.build-id/65
/usr/lib/.build-id/65/be600d12f8d00cd041ad39f1928bd446e9eec8
/usr/lib/.build-id/c2/0a150bc3094b90eef3262be31d42dc26d6c7a7
/usr/lib/.build-id/d4
/usr/lib/.build-id/d4/76c5f428f9c7b105087a174a7bd97b171356c8
/usr/lib/.build-id/f5/29b6d13de6336739fab78a6f373a81f8ee4751
/usr/lib/libnss_mymachines.so.2
/usr/lib/systemd/import-pubring.gpg
/usr/lib/systemd/system/dbus-org.freedesktop.import1.service
/usr/lib/systemd/system/dbus-org.freedesktop.machine1.service
/usr/lib/systemd/system/machine.slice
/usr/lib/systemd/system/machines.target
/usr/lib/systemd/system/machines.target.wants
/usr/lib/systemd/system/machines.target.wants/var-lib-machines.mount
/usr/lib/systemd/system/remote-fs.target.wants/var-lib-machines.mount
/usr/lib/systemd/system/systemd-importd.service
/usr/lib/systemd/system/systemd-machined.service
/usr/lib/systemd/system/[email protected]
/usr/lib/systemd/system/var-lib-machines.mount
/usr/lib/systemd/systemd-import
/usr/lib/systemd/systemd-importd
/usr/lib/systemd/systemd-machined
/usr/lib/systemd/systemd-pull
/usr/lib/tmpfiles.d/systemd-nspawn.conf
/usr/share/bash-completion/completions/machinectl
/usr/share/bash-completion/completions/systemd-nspawn
/usr/share/dbus-1/system-services/org.freedesktop.import1.service
/usr/share/dbus-1/system-services/org.freedesktop.machine1.service
/usr/share/dbus-1/system.d/org.freedesktop.import1.conf
/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf
/usr/share/man/man1/machinectl.1.gz
/usr/share/man/man1/systemd-nspawn.1.gz
/usr/share/man/man8/libnss_mymachines.so.2.8.gz
/usr/share/man/man8/nss-mymachines.8.gz
/usr/share/man/man8/systemd-importd.8.gz
/usr/share/man/man8/systemd-importd.service.8.gz
/usr/share/man/man8/systemd-machined.8.gz
/usr/share/man/man8/systemd-machined.service.8.gz
/usr/share/polkit-1/actions/org.freedesktop.import1.policy
/usr/share/polkit-1/actions/org.freedesktop.machine1.policy
/usr/share/zsh/site-functions/_machinectl
/usr/share/zsh/site-functions/_systemd-nspawn
/usr/bin/machinectl
/usr/bin/systemd-nspawn
/usr/lib/.build-id
/usr/lib/.build-id/0e
/usr/lib/.build-id/0e/15ff651d87179a3006f85667cad7a6731a32a8
/usr/lib/.build-id/2a/45444ee87901cc6c96912bb87e0e3c748c153c
/usr/lib/.build-id/83/304b25521695f2e3571e28cb257064f727056e
/usr/lib/.build-id/83/6f24945509911f377f93d4f77233451da8d98a
/usr/lib/.build-id/a3
/usr/lib/.build-id/a3/27f4bc3ba72f6ab45f071f349e41990b3a1895
/usr/lib/.build-id/ee/d7b9afd7d2a7d94c2933a6e58af1f681cb4ba0
/usr/lib/.build-id/fa
/usr/lib/.build-id/fa/365083d3b5e139bbfa0702859f7f3c602aa7f1
/usr/lib/systemd/import-pubring.gpg
/usr/lib/systemd/system/dbus-org.freedesktop.import1.service
/usr/lib/systemd/system/dbus-org.freedesktop.machine1.service
/usr/lib/systemd/system/machine.slice
/usr/lib/systemd/system/machines.target
/usr/lib/systemd/system/machines.target.wants
/usr/lib/systemd/system/machines.target.wants/var-lib-machines.mount
/usr/lib/systemd/system/remote-fs.target.wants/var-lib-machines.mount
/usr/lib/systemd/system/systemd-importd.service
/usr/lib/systemd/system/systemd-machined.service
/usr/lib/systemd/system/[email protected]
/usr/lib/systemd/system/var-lib-machines.mount
/usr/lib/systemd/systemd-import
/usr/lib/systemd/systemd-importd
/usr/lib/systemd/systemd-machined
/usr/lib/systemd/systemd-pull
/usr/lib/tmpfiles.d/systemd-nspawn.conf
/usr/lib64/libnss_mymachines.so.2
/usr/share/bash-completion/completions/machinectl
/usr/share/bash-completion/completions/systemd-nspawn
/usr/share/dbus-1/system-services/org.freedesktop.import1.service
/usr/share/dbus-1/system-services/org.freedesktop.machine1.service
/usr/share/dbus-1/system.d/org.freedesktop.import1.conf
/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf
/usr/share/man/man1/machinectl.1.gz
/usr/share/man/man1/systemd-nspawn.1.gz
/usr/share/man/man8/libnss_mymachines.so.2.8.gz
/usr/share/man/man8/nss-mymachines.8.gz
/usr/share/man/man8/systemd-importd.8.gz
/usr/share/man/man8/systemd-importd.service.8.gz
/usr/share/man/man8/systemd-machined.8.gz
/usr/share/man/man8/systemd-machined.service.8.gz
/usr/share/polkit-1/actions/org.freedesktop.import1.policy
/usr/share/polkit-1/actions/org.freedesktop.machine1.policy
/usr/share/zsh/site-functions/_machinectl
/usr/share/zsh/site-functions/_systemd-nspawn
/usr/bin/machinectl
/usr/bin/systemd-nspawn
/usr/lib/.build-id
/usr/lib/.build-id/0e
/usr/lib/.build-id/0e/d995e8ecc273341dfd9fd8eea53ee4f1c97264
/usr/lib/.build-id/34
/usr/lib/.build-id/34/b3ac6317231cd42da0af1eb90a4d349c745fe4
/usr/lib/.build-id/68
/usr/lib/.build-id/68/1295159a109949fa59ef670aaa2d5a9f6e6303
/usr/lib/.build-id/6d/91e53b15f4be3cbffacda9a603937fd39caa5b
/usr/lib/.build-id/70
/usr/lib/.build-id/70/a784068c38c263d5d15f7488a9677b94f04e2e
/usr/lib/.build-id/f5/c9e62e6e7008a4ffaa489d3479739312fc7cfa
/usr/lib/.build-id/f5/f6e745491dbfe0b669b76330f2e3da059c182d
/usr/lib/systemd/import-pubring.gpg
/usr/lib/systemd/system/dbus-org.freedesktop.import1.service
/usr/lib/systemd/system/dbus-org.freedesktop.machine1.service
/usr/lib/systemd/system/machine.slice
/usr/lib/systemd/system/machines.target
/usr/lib/systemd/system/machines.target.wants
/usr/lib/systemd/system/machines.target.wants/var-lib-machines.mount
/usr/lib/systemd/system/remote-fs.target.wants/var-lib-machines.mount
/usr/lib/systemd/system/systemd-importd.service
/usr/lib/systemd/system/systemd-machined.service
/usr/lib/systemd/system/[email protected]
/usr/lib/systemd/system/var-lib-machines.mount
/usr/lib/systemd/systemd-import
/usr/lib/systemd/systemd-importd
/usr/lib/systemd/systemd-machined
/usr/lib/systemd/systemd-pull
/usr/lib/tmpfiles.d/systemd-nspawn.conf
/usr/lib64/libnss_mymachines.so.2
/usr/share/bash-completion/completions/machinectl
/usr/share/bash-completion/completions/systemd-nspawn
/usr/share/dbus-1/system-services/org.freedesktop.import1.service
/usr/share/dbus-1/system-services/org.freedesktop.machine1.service
/usr/share/dbus-1/system.d/org.freedesktop.import1.conf
/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf
/usr/share/man/man1/machinectl.1.gz
/usr/share/man/man1/systemd-nspawn.1.gz
/usr/share/man/man8/libnss_mymachines.so.2.8.gz
/usr/share/man/man8/nss-mymachines.8.gz
/usr/share/man/man8/systemd-importd.8.gz
/usr/share/man/man8/systemd-importd.service.8.gz
/usr/share/man/man8/systemd-machined.8.gz
/usr/share/man/man8/systemd-machined.service.8.gz
/usr/share/polkit-1/actions/org.freedesktop.import1.policy
/usr/share/polkit-1/actions/org.freedesktop.machine1.policy
/usr/share/zsh/site-functions/_machinectl
/usr/share/zsh/site-functions/_systemd-nspawn
/usr/bin/machinectl
/usr/bin/systemd-nspawn
/usr/lib/.build-id
/usr/lib/.build-id/19
/usr/lib/.build-id/19/b5f6d1a7bd8ebc30c2e028d021e58a9d71ed01
/usr/lib/.build-id/28
/usr/lib/.build-id/28/878bf3daba125cc34db64fb6921cf2740ff3d8
/usr/lib/.build-id/2b
/usr/lib/.build-id/2b/b966abc9858b31d7323dbb1624f0c197abe555
/usr/lib/.build-id/59
/usr/lib/.build-id/59/be0b76124b6bef6995501690790c62918a26ce
/usr/lib/.build-id/84
/usr/lib/.build-id/84/81977782bcabfcf789d399fc54301d7279d186
/usr/lib/.build-id/d6/58523f272304c28ce28ce3b820b346d64aac97
/usr/lib/.build-id/f8
/usr/lib/.build-id/f8/780f04a6eeca740f272e8816167907a12fa716
/usr/lib/systemd/import-pubring.gpg
/usr/lib/systemd/system/dbus-org.freedesktop.import1.service
/usr/lib/systemd/system/dbus-org.freedesktop.machine1.service
/usr/lib/systemd/system/machine.slice
/usr/lib/systemd/system/machines.target
/usr/lib/systemd/system/machines.target.wants
/usr/lib/systemd/system/machines.target.wants/var-lib-machines.mount
/usr/lib/systemd/system/remote-fs.target.wants/var-lib-machines.mount
/usr/lib/systemd/system/systemd-importd.service
/usr/lib/systemd/system/systemd-machined.service
/usr/lib/systemd/system/[email protected]
/usr/lib/systemd/system/var-lib-machines.mount
/usr/lib/systemd/systemd-import
/usr/lib/systemd/systemd-importd
/usr/lib/systemd/systemd-machined
/usr/lib/systemd/systemd-pull
/usr/lib/tmpfiles.d/systemd-nspawn.conf
/usr/lib64/libnss_mymachines.so.2
/usr/share/bash-completion/completions/machinectl
/usr/share/bash-completion/completions/systemd-nspawn
/usr/share/dbus-1/system-services/org.freedesktop.import1.service
/usr/share/dbus-1/system-services/org.freedesktop.machine1.service
/usr/share/dbus-1/system.d/org.freedesktop.import1.conf
/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf
/usr/share/man/man1/machinectl.1.gz
/usr/share/man/man1/systemd-nspawn.1.gz
/usr/share/man/man8/libnss_mymachines.so.2.8.gz
/usr/share/man/man8/nss-mymachines.8.gz
/usr/share/man/man8/systemd-importd.8.gz
/usr/share/man/man8/systemd-importd.service.8.gz
/usr/share/man/man8/systemd-machined.8.gz
/usr/share/man/man8/systemd-machined.service.8.gz
/usr/share/polkit-1/actions/org.freedesktop.import1.policy
/usr/share/polkit-1/actions/org.freedesktop.machine1.policy
/usr/share/zsh/site-functions/_machinectl
/usr/share/zsh/site-functions/_systemd-nspawn
/usr/bin/machinectl
/usr/bin/systemd-nspawn
/usr/lib/.build-id
/usr/lib/.build-id/33/bd7c536c2049b7c777d3b8f0cb4537788039d2
/usr/lib/.build-id/7e/e59cc37d9b80453fe335a3234bf419344dfec0
/usr/lib/.build-id/80/009e64aa3410559910268126d15e763250e40d
/usr/lib/.build-id/82/167c7503c7d09708502098b0917405b2edb06f
/usr/lib/.build-id/86
/usr/lib/.build-id/86/afde04ec27b65c8795a687ab10c2eff6b1338e
/usr/lib/.build-id/ee/8b5deae97014acf3bea29200b9e5c62f6aca2a
/usr/lib/.build-id/f1
/usr/lib/.build-id/f1/f10758c404b42426bfc64678a4c330417888f2
/usr/lib/libnss_mymachines.so.2
/usr/lib/systemd/import-pubring.gpg
/usr/lib/systemd/system/dbus-org.freedesktop.import1.service
/usr/lib/systemd/system/dbus-org.freedesktop.machine1.service
/usr/lib/systemd/system/machine.slice
/usr/lib/systemd/system/machines.target
/usr/lib/systemd/system/machines.target.wants
/usr/lib/systemd/system/machines.target.wants/var-lib-machines.mount
/usr/lib/systemd/system/remote-fs.target.wants/var-lib-machines.mount
/usr/lib/systemd/system/systemd-importd.service
/usr/lib/systemd/system/systemd-machined.service
/usr/lib/systemd/system/[email protected]
/usr/lib/systemd/system/var-lib-machines.mount
/usr/lib/systemd/systemd-import
/usr/lib/systemd/systemd-importd
/usr/lib/systemd/systemd-machined
/usr/lib/systemd/systemd-pull
/usr/lib/tmpfiles.d/systemd-nspawn.conf
/usr/share/bash-completion/completions/machinectl
/usr/share/bash-completion/completions/systemd-nspawn
/usr/share/dbus-1/system-services/org.freedesktop.import1.service
/usr/share/dbus-1/system-services/org.freedesktop.machine1.service
/usr/share/dbus-1/system.d/org.freedesktop.import1.conf
/usr/share/dbus-1/system.d/org.freedesktop.machine1.conf
/usr/share/man/man1/machinectl.1.gz
/usr/share/man/man1/systemd-nspawn.1.gz
/usr/share/man/man8/libnss_mymachines.so.2.8.gz
/usr/share/man/man8/nss-mymachines.8.gz
/usr/share/man/man8/systemd-importd.8.gz
/usr/share/man/man8/systemd-importd.service.8.gz
/usr/share/man/man8/systemd-machined.8.gz
/usr/share/man/man8/systemd-machined.service.8.gz
/usr/share/polkit-1/actions/org.freedesktop.import1.policy
/usr/share/polkit-1/actions/org.freedesktop.machine1.policy
/usr/share/zsh/site-functions/_machinectl
/usr/share/zsh/site-functions/_systemd-nspawn

References

Summary

In this tutorial we learn how to install systemd-container on Rocky Linux 8 using yum and dnf.