LinuxCommandLibrary

debootstrap

TLDR

Create a Debian stable system

$ sudo debootstrap stable [path/to/debian-root]/ http://deb.debian.org/debian
copy
Create a minimal system
$ sudo debootstrap --variant=minbase stable [path/to/debian-root]/
copy
Create Debian Unstable with local mirror
$ sudo debootstrap sid [path/to/sid-root]/ file:///[path/to/mirror]/
copy
Switch to the bootstrapped system
$ sudo chroot [path/to/root]
copy
List available releases
$ ls /usr/share/debootstrap/scripts/
copy

SYNOPSIS

debootstrap [options] suite target [mirror]

DESCRIPTION

debootstrap installs a basic Debian system into a subdirectory. It downloads packages from a mirror and installs them to create a minimal working system that can be used for chroot environments, containers, or new installations.
The resulting system is minimal but functional, suitable for further customization.

PARAMETERS

--variant variant

minbase (minimal), buildd (build dependencies), fakechroot
--arch arch
Target architecture (amd64, i386, arm64, etc.)
--include packages
Additional packages to install
--exclude packages
Packages to exclude
--foreign
First stage only (for cross-architecture)

CAVEATS

Requires root privileges. The target directory must exist. For cross-architecture bootstrapping, qemu-user-static may be needed. After debootstrap, additional configuration (networking, fstab, etc.) is usually needed.

SEE ALSO

Copied to clipboard