Debian Chroot

From Bit Binary Wiki
Jump to: navigation, search

Contents

Introduction

I often use chroots for testing, compiling software and debian packages. This is a quick run through of the process I use.

Note: Replace highlighted text with your options

LVM

This is not mandatory but if your using LVM you might like to place the chroot a separate volume.

lvcreate -n chroot -L 60G VGNAME
mkfs.ext4 /dev/mapper/VGNAME-chroot
mkdir /chroot
mount /dev/mapper/VGNAME-chroot /chroot
Tip: You can optionally add this to /etc/fstab

Create Chroot Directory

Note: If you used LVM then you can skip this section
mkdir /chroot

Debootstrap

Install debootstrap

apt-get install binutils debootstrap

Bootstrap a debian install

debootstrap wheezy /chroot/wheezy http://mirror.internode.on.net/pub/debian

Enter the Chroot

chroot /chroot/wheezy /bin/bash

Configure the Chroot

Configure Locales

apt-get install locales
dpkg-reconfigure locales

Apt Sources

Review /etc/apt/sources.list and add/remove sources as desired.

Resources

Debian Wiki Chroot

Personal tools