Skip to content

Instantly share code, notes, and snippets.

@esmaeelE
Last active January 29, 2021 14:54
Show Gist options
  • Save esmaeelE/ab35177313793d342174c28ff4bcbc07 to your computer and use it in GitHub Desktop.
Save esmaeelE/ab35177313793d342174c28ff4bcbc07 to your computer and use it in GitHub Desktop.

Create debian chroot

  1. Create a directory that you want to use for the base system (chroot-debian in this case).

    mkdir chroot-debian

  2. Create a base system using debootstrap.

    sudo debootstrap sid chroot-debian http://ftp.de.debian.org/debian/

You can change sid to stable to use the stable distribution, and to use Debian mirror closer to your physical location for faster download speed.

  1. Mount proc and dev filesystem.

    sudo mount -o bind /dev chroot-debian/dev

    sudo mount -o bind /proc chroot-debian/proc

  2. Start chrooting environment

    sudo chroot chroot-debian /bin/bash

  3. Once done, exit the session and don't forget to unmount the dev and proc filesystem.

    sudo umount chroot-debian/dev chroot-debian/proc

Resource

build-chroot-environment

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment