How To Install schroot on Kali Linux

In this tutorial we learn how to install schroot on Kali Linux. schroot is Execute commands in a chroot environment

Introduction

In this tutorial we learn how to install schroot on Kali Linux.

What is schroot

schroot is:

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 Btrfs, ZFS, 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 Btrfs, ZFS, and LVM snapshots.

schroot shares most of its options with dchroot, but offers vastly more functionality.

There are three methods to install schroot on Kali Linux. We can use apt-get, apt and aptitude. In the following sections we will describe each method. You can choose one of them.

Install schroot Using apt-get

Update apt database with apt-get using the following command.

sudo apt-get update

After updating apt database, We can install schroot using apt-get by running the following command:

sudo apt-get -y install schroot

Install schroot Using apt

Update apt database with apt using the following command.

sudo apt update

After updating apt database, We can install schroot using apt by running the following command:

sudo apt -y install schroot

Install schroot Using aptitude

If you want to follow this method, you might need to install aptitude on Kali Linux first since aptitude is usually not installed by default on Kali Linux. Update apt database with aptitude using the following command.

sudo aptitude update

After updating apt database, We can install schroot using aptitude by running the following command:

sudo aptitude -y install schroot

How To Uninstall schroot on Kali Linux

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

sudo apt-get remove schroot

Uninstall schroot And Its Dependencies

To uninstall schroot and its dependencies that are no longer needed by Kali Linux, we can use the command below:

sudo apt-get -y autoremove schroot

Remove schroot Configurations and Data

To remove schroot configuration and data from Kali Linux we can use the following command:

sudo apt-get -y purge schroot

Remove schroot configuration, data, and all of its dependencies

We can use the following command to remove schroot configurations, data and all of its dependencies, we can use the following command:

sudo apt-get -y autoremove --purge schroot

Dependencies

schroot have the following dependencies:

References

Summary

In this tutorial we learn how to install schroot package on Kali Linux using different package management tools: apt, apt-get and aptitude.