How To Install schroot on CentOS 8

schroot is Execute commands in a chroot environment

Introduction

In this tutorial we learn how to install schroot on CentOS 8.

What is schroot

schroot allows users to execute commands or interactive shells in different chroots. Any number of named chroots may be created, and access permissions given to each, including root access for normal users, on a per-user or per-group basis. Additionally, schroot can switch to a different user in the chroot, using PAM for authentication and authorisation. All operations are logged for security. Several different types of chroot are supported, including normal directories in the filesystem, and also block devices. Sessions, persistent chroots created on the fly from files (tar with optional compression and zip) and LVM snapshots are also supported. schroot supports kernel personalities, allowing the programs run inside the chroot to have a different personality. For example, running 32-bit chroots on 64-bit systems, or even running binaries from alternative operating systems such as SVR4 or Xenix. schroot also integrates with sbuild, to allow building packages with all supported chroot types, including session-managed chroot types such as LVM snapshots. schroot shares most of its options with dchroot, but offers vastly more functionality.

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

Install schroot 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 schroot using dnf by running the following command:

sudo dnf -y install schroot

Install schroot 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 schroot using yum by running the following command:

sudo yum -y install schroot

How To Uninstall schroot on CentOS 8

To uninstall only the schroot package we can use the following command:

sudo dnf remove schroot

schroot Package Contents on CentOS 8

/etc/default/schroot
/etc/pam.d/schroot
/etc/schroot
/etc/schroot/buildd
/etc/schroot/buildd/copyfiles
/etc/schroot/buildd/fstab
/etc/schroot/buildd/nssdatabases
/etc/schroot/chroot.d
/etc/schroot/default/copyfiles
/etc/schroot/default/fstab
/etc/schroot/default/nssdatabases
/etc/schroot/desktop/copyfiles
/etc/schroot/desktop/fstab
/etc/schroot/desktop/nssdatabases
/etc/schroot/minimal/copyfiles
/etc/schroot/minimal/fstab
/etc/schroot/minimal/nssdatabases
/etc/schroot/sbuild
/etc/schroot/sbuild/copyfiles
/etc/schroot/sbuild/fstab
/etc/schroot/sbuild/nssdatabases
/etc/schroot/schroot.conf
/etc/schroot/setup.d
/etc/schroot/setup.d/00check
/etc/schroot/setup.d/05btrfs
/etc/schroot/setup.d/05file
/etc/schroot/setup.d/05lvm
/etc/schroot/setup.d/05union
/etc/schroot/setup.d/10mount
/etc/schroot/setup.d/15binfmt
/etc/schroot/setup.d/15killprocs
/etc/schroot/setup.d/20copyfiles
/etc/schroot/setup.d/20nssdatabases
/etc/schroot/setup.d/50chrootname
/etc/schroot/setup.d/70services
/etc/schroot/setup.d/99check
/usr/bin/schroot
/usr/lib/.build-id
/usr/lib/.build-id/74
/usr/lib/.build-id/74/3ccb7b2f93eb7bb19d7fa06b60141b7d8dcbd7
/usr/lib/.build-id/c3
/usr/lib/.build-id/c3/9bbf8c571e84682a0b1326e6abe05b72d25b8b
/usr/lib/.build-id/f6
/usr/lib/.build-id/f6/80c2a5ee7dc0d561b79a69b590d03d8353b8ad
/usr/lib/systemd/system/schroot.service
/usr/libexec/schroot
/usr/libexec/schroot/schroot-listmounts
/usr/libexec/schroot/schroot-mount
/usr/share/bash-completion/completions/schroot
/usr/share/doc/schroot
/usr/share/doc/schroot/AUTHORS
/usr/share/doc/schroot/ChangeLog
/usr/share/doc/schroot/HACKING
/usr/share/doc/schroot/NEWS
/usr/share/doc/schroot/README
/usr/share/doc/schroot/THANKS
/usr/share/doc/schroot/TODO
/usr/share/licenses/schroot
/usr/share/licenses/schroot/COPYING
/usr/share/locale/cs/LC_MESSAGES/schroot.mo
/usr/share/locale/da/LC_MESSAGES/schroot.mo
/usr/share/locale/de/LC_MESSAGES/schroot.mo
/usr/share/locale/en/LC_MESSAGES/schroot.mo
/usr/share/locale/eu/LC_MESSAGES/schroot.mo
/usr/share/locale/fr/LC_MESSAGES/schroot.mo
/usr/share/locale/it/LC_MESSAGES/schroot.mo
/usr/share/locale/pt/LC_MESSAGES/schroot.mo
/usr/share/locale/sv/LC_MESSAGES/schroot.mo
/usr/share/locale/vi/LC_MESSAGES/schroot.mo
/usr/share/locale/zh_CN/LC_MESSAGES/schroot.mo
/usr/share/man/de/man1/schroot.1.gz
/usr/share/man/de/man5/schroot-script-config.5.gz
/usr/share/man/de/man5/schroot-setup.5.gz
/usr/share/man/de/man5/schroot.conf.5.gz
/usr/share/man/de/man7/schroot-faq.7.gz
/usr/share/man/fr/man1/schroot.1.gz
/usr/share/man/fr/man5/schroot-script-config.5.gz
/usr/share/man/fr/man5/schroot-setup.5.gz
/usr/share/man/fr/man5/schroot.conf.5.gz
/usr/share/man/fr/man7/schroot-faq.7.gz
/usr/share/man/man1/schroot.1.gz
/usr/share/man/man5/schroot-script-config.5.gz
/usr/share/man/man5/schroot-setup.5.gz
/usr/share/man/man5/schroot.conf.5.gz
/usr/share/man/man7/schroot-faq.7.gz
/usr/share/schroot/setup/common-config
/usr/share/schroot/setup/common-data
/usr/share/schroot/setup/common-functions
/var/lib/schroot
/var/lib/schroot/session

References

Summary

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