Differences between revisions 27 and 78 (spanning 51 versions)
Revision 27 as of 2020-05-31 02:26:55
Size: 2099
Editor: coringao
Comment:
Revision 78 as of 2021-04-14 09:25:37
Size: 6265
Editor: GuillemJover
Comment: Use OpenPGP instead of GPG when referring to keys or the standard
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
## page was renamed from packages-schroot
ToDo: merge this with [[Schroot]]
Line 3: Line 6:
<<TableOfContents(3)>>
Line 5: Line 10:
== Chroot Manager ==
Line 15: Line 18:
== Starting prison for packages == == Preparing environment for your caged Debian packages ==
Line 21: Line 24:
||<#ADADAC -4 : tablewidth="70%" style="border: medium none ;-moz-border-radius-topleft: 30px ;-moz-border-radius-topright: 30px;"> # apt install debootstrap schroot||

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

||<#ADADAC -4 : tablewidth="70%" style="border: medium none ;-moz-border-radius-topleft: 30px ;-moz-border-radius-topright: 30px;"> # cp /etc/schroot/schroot.conf /etc/schroot/schroot.conf.old||

||<#ADADAC -4 : tablewidth="70%" style="border: medium none ;-moz-border-radius-topleft: 30px ;-moz-border-radius-topright: 30px;"> # '''editor''' /etc/schroot/schroot.conf||

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

Copy and paste into the file.

||<#EAE5DA -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> [unstable]<<BR>> description=debian unstable<<BR>> type=directory<<BR>> directory=/srv/chroot/unstable<<BR>> users=your-username<<BR>> root-groups=root<<BR>> preserve-environment=true<<BR>>||

=== 1. Installing the Debian base in the cage ===
{{{
# 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.

||<#EAE5DA -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;">[unstable-amd64]<<BR>> description=debian unstable amd64<<BR>> type=directory<<BR>> directory=/srv/chroot/unstable-amd64<<BR>> users='''your-username'''<<BR>> root-groups=root<<BR>> preserve-environment=true<<BR>>||

=== Installing the caged Debian base ===
Line 39: Line 50:
||<#ADADAC -4 : tablewidth="70%" style="border: medium none ;-moz-border-radius-topleft: 30px ;-moz-border-radius-topright: 30px;"> # mkdir -p /srv/chroot/unstable||

||<#ADADAC -4 : tablewidth="70%" style="border: medium none ;-moz-border-radius-topleft: 30px ;-moz-border-radius-topright: 30px;"> # debootstrap --arch amd64 unstable /srv/chroot/unstable [[https://deb.debian.org/debian | https://deb.debian.org/debian ||
{{{
# mkdir -p /srv/chroot/unstable-amd64
}}}

{{{
# debootstrap --arch amd64 unstable /srv/chroot/unstable-amd64 https://deb.debian.org/debian
}}}

=== Preparing caging ===

{{{
# chroot /srv/chroot/unstable-amd64
}}}

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

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

=== Checking caging ===

{{{
user@debian: ~$ schroot -l
chroot:unstable-amd64
}}}

=== Accessing caged public user ===

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

=== Accessing private caged (root) ===

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

== Basic Debian packaging configurations ==

||<#EAE5DA -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> ''Thanks to [[https://wiki.debian.org/Eriberto | Eriberto]] and I recommend everyone to access this link http://debianet.com.br (Portuguese - Brazil) for more details on how to package your software in Debian.''||

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

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

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

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

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

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

||<#EAE5DA -4 style="border: medium none ;-moz-border-radius-bottomleft: 30px ;"> alias ls="ls --color=auto"<<BR>> alias tree="tree -aC"<<BR>> alias debuildsa="dpkg-buildpackage -sa -k'''0987654321ABC1234567890DFG0987654321HIJL'''" # --> your OpenPGP key.<<BR>> alias uscan="uscan --verbose --report"<<BR>> alias apt-cache="LANG=C apt-cache"<<BR>> alias man="LANG=C man"<<BR>> export DEBFULLNAME="'''put-your-full-name'''"<<BR>> export DEBEMAIL="'''put-your-email'''"<<BR>> export EDITOR="'''put-your-favorite-text-editor'''"<<BR>> export QUILT_PATCHES="debian/patches"<<BR>> export QUILT_DIFF_ARGS="--no-timestamps --no-index -pab"<<BR>> export QUILT_REFRESH_ARGS="--no-timestamps --no-index -pab"<<BR>> mount /proc<<BR>>||

Save and close.

=== 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 https://deb.debian.org/debian unstable main
deb-src https://deb.debian.org/debian 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 how-can-i-help locales quilt renameutils spell splitpatch tree
}}}

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

{{attachment:locales.png}}

''It is recommended that resetting '''locales''' leave "'''C.UTF-8'''" as the default.''

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

=== 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
}}}

=== Enabling the OpenPGP key to sign packages ===

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


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

{{{
DEBSIGN_KEYID=0987654321ABC1234567890DFG0987654321HIJL
}}}

Save and close. With that, schroot is ready for Debian packaging and you don't need to be root to get the job done.

'''NOTE:''' If an error message occurs when you are doing an "update/dist-upgrade" mentioning:

{{{
dpkg: unrecoverable fatal error, aborting:
 unknown system group 'Debian-exim' in statoverride file; the system group got removed
 before the override, which is most probably a packaging bug, to recover you
 can remove the override manually with dpkg-statoverride
}}}

To resolve, you might need to remove the statoverride entry.

{{{
(unstable-amd64)root@debian:~# dpkg-statoverride --list | grep Debian-exim
(unstable-amd64)root@debian:~# dpkg-statoverride --remove /etc/exim4/passwd.client
}}}

----

This wiki is a support and documentation resource for the [[https://www.debian.org | Debian]] project. You are free to make improvements and corrections to this published content.

----

CategorySystemAdministration | CategoryVirtualization

----

ToDo: merge this with Schroot

debian-cage.png

PACKAGES STUCK WITH SCHROOT

Allows you to configure chroots without requiring root credentials.

For a better knowledge on the subject:

wiki.debian.org/Schroot

wiki.debian.org/Debootstrap

Preparing environment for your caged Debian packages

jail.png

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.

[unstable-amd64]
description=debian unstable amd64
type=directory
directory=/srv/chroot/unstable-amd64
users=your-username
root-groups=root
preserve-environment=true

Installing the caged Debian base

schroot.png

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

# debootstrap --arch amd64 unstable /srv/chroot/unstable-amd64 https://deb.debian.org/debian

Preparing caging

# chroot /srv/chroot/unstable-amd64

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

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

Checking caging

user@debian: ~$ schroot -l
chroot:unstable-amd64

Accessing caged public user

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

Accessing private caged (root)

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

Basic Debian packaging configurations

Thanks to Eriberto and I recommend everyone to access this link http://debianet.com.br (Portuguese - Brazil) for more details on how to package your software in Debian.

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

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

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

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 OpenPGP 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.

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 https://deb.debian.org/debian unstable main
deb-src https://deb.debian.org/debian 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 how-can-i-help locales quilt renameutils spell splitpatch tree

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

locales.png

It is recommended that resetting locales leave "C.UTF-8" as the default.

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

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

Enabling the OpenPGP key to sign packages

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

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

DEBSIGN_KEYID=0987654321ABC1234567890DFG0987654321HIJL

Save and close. With that, schroot is ready for Debian packaging and you don't need to be root to get the job done.

NOTE: If an error message occurs when you are doing an "update/dist-upgrade" mentioning:

dpkg: unrecoverable fatal error, aborting:
 unknown system group 'Debian-exim' in statoverride file; the system group got removed
 before the override, which is most probably a packaging bug, to recover you
 can remove the override manually with dpkg-statoverride

To resolve, you might need to remove the statoverride entry.

(unstable-amd64)root@debian:~# dpkg-statoverride --list | grep Debian-exim
(unstable-amd64)root@debian:~# dpkg-statoverride --remove /etc/exim4/passwd.client


This wiki is a support and documentation resource for the Debian project. You are free to make improvements and corrections to this published content.


CategorySystemAdministration | CategoryVirtualization