Debian – Why debootstrap can only run as root

debiandebian-installerdebootstrapnot-root-user

I want to download Debian system using debootstrap (creating chroot environment) and when I run debootstrap stable ./dir $debian_ftp, debootstrap says:

E: debootstrap can only run as root

Why can't debootstrap be run without root permissions?

Best Answer

You need to be able to create a chroot when you use debootstrap. Plus if you plan on partitioning, or doing any mounts, etc. you will need root permissions.

If you check out the debootstrap manpage you should be able to use debootstrap with the --variant=fakechroot option to use fakechroot, which installs the packages without root privileges. An example in your case would be something along the lines of this:

debootstrap --variant=fakechroot stable ./dir $debian_ftp

Please read the Wiki for more information on how to use debootstrap.

Related Question