Few hints for chroot users

During last months I used chroot functionality many times — mostly to test my cross compilers in clean environment. In that time I collected list of hints for having less work.

  • Use APT proxy. I am using APT-Cacher NG for all my machines and chroots. This allows for APT lines like http://localhost:3142/pl.archive.ubuntu.com/ubuntu and gives 30MB/s download speed when I need to install something.
  • Disable installing of recommended packages. Most of time I do not need those and installing “texlive-extra-doc” takes precious megabytes. Just create /etc/apt/apt.conf.d/99-no-extra file with:

APT::Install-Recommends “0”;
APT::Install-Suggests “0”;

  • Mount /proc, /dev, /dev/pts filesystems — some packages depend on them during installation.
  • Set locale to “C” — simple export LC_ALL=C is enough. Otherwise applications will complain about missing l18n informations.
  • Create user with same UID/GID as your host one and use it for any work — will allow to use editors from host system to edit files.
  • Kill each daemon which started after installation — who needs several Samba daemons on one machine?