Chroot Manager

Allows you to configure chroots without requiring root credentials.

For a better knowledge on the subject:

Starting prison for packages


To start the installations, we will download the following packages:

# apt install debootstrap schroot

Once installed, we will edit the "/etc/schroot/schroot.conf" file.

# cp /etc/schroot/schroot.conf /etc/schroot/schroot.conf.old

# editor /etc/schroot/schroot.conf

{*} editor = your favorite text editor: nano, vim, mcedit, etc ...

In this model, we will do this in the amd64 architecture, but you can change or create it in the i386 architecture.

Copy and paste into the file.

description=debian unstable amd64

1. Installing the Debian base in the cage


# mkdir -p /srv/chroot/unstable-amd64

# debootstrap --arch amd64 unstable /srv/chroot/unstable-amd64

2. Entering the cage

# chroot /srv/chroot/unstable

# echo proc /proc proc defaults 0 0 >> /etc/fstab

# echo mount /proc >> /etc/bash.bashrc

After these settings, type "exit" or press "Ctrl+D" to close everything.

Confirming that the configured prison is correct

user@debian: ~$ schroot -l

Entering prison as a user:

user@debian:~$ schroot -c unstable-amd64

Entering private prison: (root)

user@debian:~$ schroot -c unstable-amd64 -u root

Basic Debian packaging configurations

We will do root access in the "schroot" configured to install some important packages for Debian packaging.

|<#ADADAC -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> user@debian:~$ schroot -c unstable-amd64 -u root||

{*} editor = your favorite text editor: nano, vim, mcedit, etc...

1. Adjusting the "/etc/bash.bashrc" file

(unstable-amd64)root@debian:~# editor /etc/bash.bashrc

Insert at the end of the file /etc/bash.bashrc

alias ls="ls --color=auto"
alias tree="tree -aC"
alias debuildsa="dpkg-buildpackage -sa -k0987654321ABC1234567890DFG0987654321HIJL" --> your GPG key.
alias uscan="uscan --verbose --report"
alias apt-cache="LANG=C apt-cache"
alias man="LANG=C man"
export DEBFULLNAME="put-your-full-name"
export DEBEMAIL="put-your-email"
export EDITOR="put-your-favorite-text-editor"
export QUILT_PATCHES="debian/patches"
export QUILT_DIFF_ARGS="--no-timestamps --no-index -pab"
export QUILT_REFRESH_ARGS="--no-timestamps --no-index -pab"
mount /proc

Save and close.

2. Adjusting the "/etc/apt/sources.list" file

(unstable-amd64)root@debian:~# editor /etc/apt/sources.list

Edit the file, duplicate the existing line and change the beginning of the second line from "deb" to "deb-src". The end result will be:

deb unstable main
deb-src unstable main

Save, close and update:

(unstable-amd64)root@debian:~# apt update && apt upgrade

We can now install additional procedures for Debian packaging.

(unstable-amd64)root@debian:~# apt install autopkgtest blhc devscripts dh-make dput-ng git-buildpackage
how-can-i-help locales quilt renameutils spell splitpatch tree

(unstable-amd64)root@debian:~# dpkg-reconfigure locales tzdata

(unstable-amd64)root@debian:~# apt autoremove && apt autoclean

3. Adjusting the "/etc/lintianrc" file

(unstable-amd64)root@debian:~# editor /etc/lintianrc

Enable the following lines:

display-info = yes
pedantic = yes
display-experimental = yes
color = auto

4. Enabling the GPG key to sign packages

Edit the "/etc/devscripts.conf" file and enter your GPG key on the DEBSIGN_KEYID line and activate.

(unstable-amd64)root@debian:~# editor /etc/devscripts.conf