Table des matières

Chroot

Installation

chroot est installé de base sur la distribution Debian. Il est probable que ça soit le cas pour les autres distributions GNU/Linux majeures.

En revanche, pour installer une Debian dans un chroot, on va installer debootstrap. Installation sur une Debian :

# apt search debootstrap
debootstrap/stable 1.0.89 all
  Installation d'un système Debian de base
 
# apt install debootstrap
(...)

Installation sur une Fedora :

[simon@localhost chroot]$ su
Mot de passe : 
 
[root@localhost chroot]# yum search debootstrap

Cliquez pour afficher ⇲

Cliquez pour masquer ⇱

Dernière vérification de l’expiration des métadonnées effectuée il y a 1:25:28 le ven 13 oct 2017 09:42:00 CEST.
===================================================== Nom Exactly Matched: debootstrap ======================================================
debootstrap.noarch : Debian GNU/Linux bootstrapper
[root@localhost chroot]# yum install debootstrap

Cliquez pour afficher ⇲

Cliquez pour masquer ⇱

Dernière vérification de l’expiration des métadonnées effectuée il y a 0:00:00 le ven 13 oct 2017 11:07:41 CEST.
Dépendances résolues.
=============================================================================================================================================
 Paquet                                  Architecture               Version                                Dépôt                       Taille
=============================================================================================================================================
Installation de :
 debootstrap                             noarch                     1.0.91-1.fc26                          updates                      80 k
Installation des dépendances:
 keyrings-filesystem                     noarch                     1-6.fc26                               fedora                      7.1 k
Installation des dépendances faibles:
 debian-keyring                          noarch                     2017.6-1.fc26                          updates                      58 k
 ubu-keyring                             noarch                     2016.10.27-2.fc26                      fedora                       21 k
 
Résumé de la transaction
=============================================================================================================================================
Installer  4 Paquets
 
Taille totale des téléchargements : 166 k
Taille des paquets installés : 338 k
Voulez-vous continuer ? [o/N] :o
Téléchargement des paquets :
(1/4): keyrings-filesystem-1-6.fc26.noarch.rpm                                                                31 kB/s | 7.1 kB     00:00    
(2/4): debootstrap-1.0.91-1.fc26.noarch.rpm                                                                  277 kB/s |  80 kB     00:00    
(3/4): debian-keyring-2017.6-1.fc26.noarch.rpm                                                               192 kB/s |  58 kB     00:00    
(4/4): ubu-keyring-2016.10.27-2.fc26.noarch.rpm                                                              151 kB/s |  21 kB     00:00    
---------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                         72 kB/s | 166 kB     00:02     
Test de la transaction en cours
La vérification de la transaction a réussi.
Lancement de la transaction de test
Transaction de test réussie.
Exécution de la transaction
  Préparation           :                                                                                                                1/1 
  Installation de       : keyrings-filesystem-1-6.fc26.noarch                                                                            1/4 
  Installation de       : debian-keyring-2017.6-1.fc26.noarch                                                                            2/4 
  Installation de       : ubu-keyring-2016.10.27-2.fc26.noarch                                                                           3/4 
  Installation de       : debootstrap-1.0.91-1.fc26.noarch                                                                               4/4 
  Exécution du scriptlet: debootstrap-1.0.91-1.fc26.noarch                                                                               4/4 
  Vérification de       : debootstrap-1.0.91-1.fc26.noarch                                                                               1/4 
  Vérification de       : debian-keyring-2017.6-1.fc26.noarch                                                                            2/4 
  Vérification de       : keyrings-filesystem-1-6.fc26.noarch                                                                            3/4 
  Vérification de       : ubu-keyring-2016.10.27-2.fc26.noarch                                                                           4/4 
 
Installé :
  debootstrap.noarch 1.0.91-1.fc26              debian-keyring.noarch 2017.6-1.fc26           ubu-keyring.noarch 2016.10.27-2.fc26          
  keyrings-filesystem.noarch 1-6.fc26          
 
Terminé !

Mise en place d'une installation "chroot"

Debian Stretch

On crée le dossier qui va accueillir notre nouvelle racine :

root@laptop:/home/simon# mkdir -p chroot/debian-stretch

Et on lance l'installation d'une Debian Stretch dans le dossier qu'on vient de créer :

root@laptop:/home/simon# debootstrap --arch=amd64 --include=locales-all stretch chroot/debian-stretch http://ftp.be.debian.org/debian/

Cliquez pour afficher ⇲

Cliquez pour masquer ⇱

I: Retrieving InRelease 
I: Retrieving Release 
I: Retrieving Release.gpg 
I: Checking Release signature
I: Valid Release signature (key id 067E3C456BAE240ACEE88F6FEF0F382A1A7B6500)
I: Retrieving Packages 
I: Validating Packages 
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Found additional required dependencies: libaudit-common libaudit1 libbz2-1.0 libcap-ng0 libdb5.3 libdebconfclient0 libgcrypt20 libgpg-error0 liblz4-1 libncursesw5 libsemanage-common libsemanage1 libsystemd0 libudev1 libustr-1.0-1 
I: Found additional base dependencies: dmsetup gnupg-agent libapparmor1 libassuan0 libbsd0 libc-l10n libcap2 libcryptsetup4 libdevmapper1.02.1 libdns-export162 libelf1 libfastjson4 libffi6 libgmp10 libgnutls30 libhogweed4 libidn11 libidn2-0 libip4tc0 libip6tc0 libiptc0 libisc-export160 libksba8 liblocale-gettext-perl liblognorm5 libmnl0 libncurses5 libnetfilter-conntrack3 libnettle6 libnfnetlink0 libnpth0 libp11-kit0 libpsl5 libseccomp2 libsqlite3-0 libtasn1-6 libtext-charwidth-perl libtext-iconv-perl libtext-wrapi18n-perl libunistring0 libxtables12 pinentry-curses xxd 
I: Checking component main on http://ftp.be.debian.org/debian...
I: Retrieving libacl1 2.2.52-3+b1
I: Validating libacl1 2.2.52-3+b1
I: Retrieving adduser 3.115
I: Validating adduser 3.115
I: Retrieving libapparmor1 2.11.0-3
I: Validating libapparmor1 2.11.0-3
I: Retrieving apt 1.4.8
I: Validating apt 1.4.8
I: Retrieving apt-utils 1.4.8
I: Validating apt-utils 1.4.8
I: Retrieving libapt-inst2.0 1.4.8
I: Validating libapt-inst2.0 1.4.8
I: Retrieving libapt-pkg5.0 1.4.8
I: Validating libapt-pkg5.0 1.4.8
I: Retrieving libattr1 1:2.4.47-2+b2
I: Validating libattr1 1:2.4.47-2+b2
I: Retrieving libaudit-common 1:2.6.7-2
I: Validating libaudit-common 1:2.6.7-2
I: Retrieving libaudit1 1:2.6.7-2
I: Validating libaudit1 1:2.6.7-2
I: Retrieving base-files 9.9+deb9u1
I: Validating base-files 9.9+deb9u1
I: Retrieving base-passwd 3.5.43
I: Validating base-passwd 3.5.43
I: Retrieving bash 4.4-5
I: Validating bash 4.4-5
I: Retrieving libdns-export162 1:9.10.3.dfsg.P4-12.3+deb9u3
I: Validating libdns-export162 1:9.10.3.dfsg.P4-12.3+deb9u3
I: Retrieving libisc-export160 1:9.10.3.dfsg.P4-12.3+deb9u3
I: Validating libisc-export160 1:9.10.3.dfsg.P4-12.3+deb9u3
I: Retrieving bsdmainutils 9.0.12+nmu1
I: Validating bsdmainutils 9.0.12+nmu1
I: Retrieving libbz2-1.0 1.0.6-8.1
I: Validating libbz2-1.0 1.0.6-8.1
I: Retrieving libdebconfclient0 0.227
I: Validating libdebconfclient0 0.227
I: Retrieving coreutils 8.26-3
I: Validating coreutils 8.26-3
I: Retrieving cpio 2.11+dfsg-6
I: Validating cpio 2.11+dfsg-6
I: Retrieving cron 3.0pl1-128+b1
I: Validating cron 3.0pl1-128+b1
I: Retrieving libcryptsetup4 2:1.7.3-4
I: Validating libcryptsetup4 2:1.7.3-4
I: Retrieving dash 0.5.8-2.4
I: Validating dash 0.5.8-2.4
I: Retrieving libdb5.3 5.3.28-12+deb9u1
I: Validating libdb5.3 5.3.28-12+deb9u1
I: Retrieving debconf 1.5.61
I: Validating debconf 1.5.61
I: Retrieving debconf-i18n 1.5.61
I: Validating debconf-i18n 1.5.61
I: Retrieving debian-archive-keyring 2017.5
I: Validating debian-archive-keyring 2017.5
I: Retrieving debianutils 4.8.1.1
I: Validating debianutils 4.8.1.1
I: Retrieving diffutils 1:3.5-3
I: Validating diffutils 1:3.5-3
I: Retrieving dmidecode 3.0-4
I: Validating dmidecode 3.0-4
I: Retrieving dpkg 1.18.24
I: Validating dpkg 1.18.24
I: Retrieving e2fslibs 1.43.4-2
I: Validating e2fslibs 1.43.4-2
I: Retrieving e2fsprogs 1.43.4-2
I: Validating e2fsprogs 1.43.4-2
I: Retrieving libcomerr2 1.43.4-2
I: Validating libcomerr2 1.43.4-2
I: Retrieving libss2 1.43.4-2
I: Validating libss2 1.43.4-2
I: Retrieving libelf1 0.168-1
I: Validating libelf1 0.168-1
I: Retrieving findutils 4.6.0+git+20161106-2
I: Validating findutils 4.6.0+git+20161106-2
I: Retrieving gcc-6-base 6.3.0-18
I: Validating gcc-6-base 6.3.0-18
I: Retrieving libgcc1 1:6.3.0-18
I: Validating libgcc1 1:6.3.0-18
I: Retrieving libstdc++6 6.3.0-18
I: Validating libstdc++6 6.3.0-18
I: Retrieving libgdbm3 1.8.3-14
I: Validating libgdbm3 1.8.3-14
I: Retrieving libc-bin 2.24-11+deb9u1
I: Validating libc-bin 2.24-11+deb9u1
I: Retrieving libc-l10n 2.24-11+deb9u1
I: Validating libc-l10n 2.24-11+deb9u1
I: Retrieving libc6 2.24-11+deb9u1
I: Validating libc6 2.24-11+deb9u1
I: Retrieving locales-all 2.24-11+deb9u1
I: Validating locales-all 2.24-11+deb9u1
I: Retrieving multiarch-support 2.24-11+deb9u1
I: Validating multiarch-support 2.24-11+deb9u1
I: Retrieving libgmp10 2:6.1.2+dfsg-1
I: Validating libgmp10 2:6.1.2+dfsg-1
I: Retrieving gnupg 2.1.18-8~deb9u1
I: Validating gnupg 2.1.18-8~deb9u1
I: Retrieving gnupg-agent 2.1.18-8~deb9u1
I: Validating gnupg-agent 2.1.18-8~deb9u1
I: Retrieving gpgv 2.1.18-8~deb9u1
I: Validating gpgv 2.1.18-8~deb9u1
I: Retrieving libgnutls30 3.5.8-5+deb9u3
I: Validating libgnutls30 3.5.8-5+deb9u3
I: Retrieving grep 2.27-2
I: Validating grep 2.27-2
I: Retrieving gzip 1.6-5+b1
I: Validating gzip 1.6-5+b1
I: Retrieving hostname 3.18+b1
I: Validating hostname 3.18+b1
I: Retrieving ifupdown 0.8.19
I: Validating ifupdown 0.8.19
I: Retrieving init 1.48
I: Validating init 1.48
I: Retrieving init-system-helpers 1.48
I: Validating init-system-helpers 1.48
I: Retrieving iproute2 4.9.0-1
I: Validating iproute2 4.9.0-1
I: Retrieving iptables 1.6.0+snapshot20161117-6
I: Validating iptables 1.6.0+snapshot20161117-6
I: Retrieving libip4tc0 1.6.0+snapshot20161117-6
I: Validating libip4tc0 1.6.0+snapshot20161117-6
I: Retrieving libip6tc0 1.6.0+snapshot20161117-6
I: Validating libip6tc0 1.6.0+snapshot20161117-6
I: Retrieving libiptc0 1.6.0+snapshot20161117-6
I: Validating libiptc0 1.6.0+snapshot20161117-6
I: Retrieving libxtables12 1.6.0+snapshot20161117-6
I: Validating libxtables12 1.6.0+snapshot20161117-6
I: Retrieving iputils-ping 3:20161105-1
I: Validating iputils-ping 3:20161105-1
I: Retrieving isc-dhcp-client 4.3.5-3
I: Validating isc-dhcp-client 4.3.5-3
I: Retrieving isc-dhcp-common 4.3.5-3
I: Validating isc-dhcp-common 4.3.5-3
I: Retrieving kmod 23-2
I: Validating kmod 23-2
I: Retrieving libkmod2 23-2
I: Validating libkmod2 23-2
I: Retrieving libassuan0 2.4.3-2
I: Validating libassuan0 2.4.3-2
I: Retrieving libbsd0 0.8.3-1
I: Validating libbsd0 0.8.3-1
I: Retrieving libcap-ng0 0.7.7-3+b1
I: Validating libcap-ng0 0.7.7-3+b1
I: Retrieving libcap2 1:2.25-1
I: Validating libcap2 1:2.25-1
I: Retrieving libestr0 0.1.10-2
I: Validating libestr0 0.1.10-2
I: Retrieving libfastjson4 0.99.4-1
I: Validating libfastjson4 0.99.4-1
I: Retrieving libffi6 3.2.1-6
I: Validating libffi6 3.2.1-6
I: Retrieving libgcrypt20 1.7.6-2+deb9u2
I: Validating libgcrypt20 1.7.6-2+deb9u2
I: Retrieving libgpg-error0 1.26-2
I: Validating libgpg-error0 1.26-2
I: Retrieving libidn11 1.33-1
I: Validating libidn11 1.33-1
I: Retrieving libidn2-0 0.16-1+deb9u1
I: Validating libidn2-0 0.16-1+deb9u1
I: Retrieving libksba8 1.3.5-2
I: Validating libksba8 1.3.5-2
I: Retrieving liblocale-gettext-perl 1.07-3+b1
I: Validating liblocale-gettext-perl 1.07-3+b1
I: Retrieving liblogging-stdlog0 1.0.5-2+b2
I: Validating liblogging-stdlog0 1.0.5-2+b2
I: Retrieving liblognorm5 2.0.1-1.1+b1
I: Validating liblognorm5 2.0.1-1.1+b1
I: Retrieving libmnl0 1.0.4-2
I: Validating libmnl0 1.0.4-2
I: Retrieving libnetfilter-conntrack3 1.0.6-2
I: Validating libnetfilter-conntrack3 1.0.6-2
I: Retrieving libnfnetlink0 1.0.1-3
I: Validating libnfnetlink0 1.0.1-3
I: Retrieving libpipeline1 1.4.1-2
I: Validating libpipeline1 1.4.1-2
I: Retrieving libpsl5 0.17.0-3
I: Validating libpsl5 0.17.0-3
I: Retrieving libseccomp2 2.3.1-2.1
I: Validating libseccomp2 2.3.1-2.1
I: Retrieving libselinux1 2.6-3+b3
I: Validating libselinux1 2.6-3+b3
I: Retrieving libsemanage-common 2.6-2
I: Validating libsemanage-common 2.6-2
I: Retrieving libsemanage1 2.6-2
I: Validating libsemanage1 2.6-2
I: Retrieving libsepol1 2.6-2
I: Validating libsepol1 2.6-2
I: Retrieving libtasn1-6 4.10-1.1
I: Validating libtasn1-6 4.10-1.1
I: Retrieving libtext-charwidth-perl 0.04-7+b5
I: Validating libtext-charwidth-perl 0.04-7+b5
I: Retrieving libtext-iconv-perl 1.7-5+b4
I: Validating libtext-iconv-perl 1.7-5+b4
I: Retrieving libtext-wrapi18n-perl 0.06-7.1
I: Validating libtext-wrapi18n-perl 0.06-7.1
I: Retrieving libunistring0 0.9.6+really0.9.3-0.1
I: Validating libunistring0 0.9.6+really0.9.3-0.1
I: Retrieving logrotate 3.11.0-0.1
I: Validating logrotate 3.11.0-0.1
I: Retrieving lsb-base 9.20161125
I: Validating lsb-base 9.20161125
I: Retrieving dmsetup 2:1.02.137-2
I: Validating dmsetup 2:1.02.137-2
I: Retrieving libdevmapper1.02.1 2:1.02.137-2
I: Validating libdevmapper1.02.1 2:1.02.137-2
I: Retrieving liblz4-1 0.0~r131-2+b1
I: Validating liblz4-1 0.0~r131-2+b1
I: Retrieving mawk 1.3.3-17+b3
I: Validating mawk 1.3.3-17+b3
I: Retrieving nano 2.7.4-1
I: Validating nano 2.7.4-1
I: Retrieving libncurses5 6.0+20161126-1+deb9u1
I: Validating libncurses5 6.0+20161126-1+deb9u1
I: Retrieving libncursesw5 6.0+20161126-1+deb9u1
I: Validating libncursesw5 6.0+20161126-1+deb9u1
I: Retrieving libtinfo5 6.0+20161126-1+deb9u1
I: Validating libtinfo5 6.0+20161126-1+deb9u1
I: Retrieving ncurses-base 6.0+20161126-1+deb9u1
I: Validating ncurses-base 6.0+20161126-1+deb9u1
I: Retrieving ncurses-bin 6.0+20161126-1+deb9u1
I: Validating ncurses-bin 6.0+20161126-1+deb9u1
I: Retrieving netbase 5.4
I: Validating netbase 5.4
I: Retrieving libhogweed4 3.3-1+b2
I: Validating libhogweed4 3.3-1+b2
I: Retrieving libnettle6 3.3-1+b2
I: Validating libnettle6 3.3-1+b2
I: Retrieving libnewt0.52 0.52.19-1+b1
I: Validating libnewt0.52 0.52.19-1+b1
I: Retrieving whiptail 0.52.19-1+b1
I: Validating whiptail 0.52.19-1+b1
I: Retrieving libnpth0 1.3-1
I: Validating libnpth0 1.3-1
I: Retrieving libssl1.1 1.1.0f-3
I: Validating libssl1.1 1.1.0f-3
I: Retrieving libssl1.0.2 1.0.2l-2
I: Validating libssl1.0.2 1.0.2l-2
I: Retrieving libp11-kit0 0.23.3-2
I: Validating libp11-kit0 0.23.3-2
I: Retrieving libpam-modules 1.1.8-3.6
I: Validating libpam-modules 1.1.8-3.6
I: Retrieving libpam-modules-bin 1.1.8-3.6
I: Validating libpam-modules-bin 1.1.8-3.6
I: Retrieving libpam-runtime 1.1.8-3.6
I: Validating libpam-runtime 1.1.8-3.6
I: Retrieving libpam0g 1.1.8-3.6
I: Validating libpam0g 1.1.8-3.6
I: Retrieving libpcre3 2:8.39-3
I: Validating libpcre3 2:8.39-3
I: Retrieving perl-base 5.24.1-3+deb9u2
I: Validating perl-base 5.24.1-3+deb9u2
I: Retrieving pinentry-curses 1.0.0-2
I: Validating pinentry-curses 1.0.0-2
I: Retrieving libpopt0 1.16-10+b2
I: Validating libpopt0 1.16-10+b2
I: Retrieving libprocps6 2:3.3.12-3
I: Validating libprocps6 2:3.3.12-3
I: Retrieving procps 2:3.3.12-3
I: Validating procps 2:3.3.12-3
I: Retrieving libreadline7 7.0-3
I: Validating libreadline7 7.0-3
I: Retrieving readline-common 7.0-3
I: Validating readline-common 7.0-3
I: Retrieving rsyslog 8.24.0-1
I: Validating rsyslog 8.24.0-1
I: Retrieving sed 4.4-1
I: Validating sed 4.4-1
I: Retrieving sensible-utils 0.0.9
I: Validating sensible-utils 0.0.9
I: Retrieving login 1:4.4-4.1
I: Validating login 1:4.4-4.1
I: Retrieving passwd 1:4.4-4.1
I: Validating passwd 1:4.4-4.1
I: Retrieving libslang2 2.3.1-5
I: Validating libslang2 2.3.1-5
I: Retrieving libsqlite3-0 3.16.2-5
I: Validating libsqlite3-0 3.16.2-5
I: Retrieving libsystemd0 232-25+deb9u1
I: Validating libsystemd0 232-25+deb9u1
I: Retrieving libudev1 232-25+deb9u1
I: Validating libudev1 232-25+deb9u1
I: Retrieving systemd 232-25+deb9u1
I: Validating systemd 232-25+deb9u1
I: Retrieving systemd-sysv 232-25+deb9u1
I: Validating systemd-sysv 232-25+deb9u1
I: Retrieving udev 232-25+deb9u1
I: Validating udev 232-25+deb9u1
I: Retrieving sysvinit-utils 2.88dsf-59.9
I: Validating sysvinit-utils 2.88dsf-59.9
I: Retrieving tar 1.29b-1.1
I: Validating tar 1.29b-1.1
I: Retrieving tasksel 3.39
I: Validating tasksel 3.39
I: Retrieving tasksel-data 3.39
I: Validating tasksel-data 3.39
I: Retrieving tzdata 2017b-1
I: Validating tzdata 2017b-1
I: Retrieving libustr-1.0-1 1.0.4-6
I: Validating libustr-1.0-1 1.0.4-6
I: Retrieving bsdutils 1:2.29.2-1
I: Validating bsdutils 1:2.29.2-1
I: Retrieving libblkid1 2.29.2-1
I: Validating libblkid1 2.29.2-1
I: Retrieving libfdisk1 2.29.2-1
I: Validating libfdisk1 2.29.2-1
I: Retrieving libmount1 2.29.2-1
I: Validating libmount1 2.29.2-1
I: Retrieving libsmartcols1 2.29.2-1
I: Validating libsmartcols1 2.29.2-1
I: Retrieving libuuid1 2.29.2-1
I: Validating libuuid1 2.29.2-1
I: Retrieving mount 2.29.2-1
I: Validating mount 2.29.2-1
I: Retrieving util-linux 2.29.2-1
I: Validating util-linux 2.29.2-1
I: Retrieving vim-common 2:8.0.0197-4+deb9u1
I: Validating vim-common 2:8.0.0197-4+deb9u1
I: Retrieving vim-tiny 2:8.0.0197-4+deb9u1
I: Validating vim-tiny 2:8.0.0197-4+deb9u1
I: Retrieving xxd 2:8.0.0197-4+deb9u1
I: Validating xxd 2:8.0.0197-4+deb9u1
I: Retrieving wget 1.18-5
I: Validating wget 1.18-5
I: Retrieving libxapian30 1.4.3-2
I: Validating libxapian30 1.4.3-2
I: Retrieving liblzma5 5.2.2-1.2+b1
I: Validating liblzma5 5.2.2-1.2+b1
I: Retrieving zlib1g 1:1.2.8.dfsg-5
I: Validating zlib1g 1:1.2.8.dfsg-5
I: Chosen extractor for .deb packages: ar
I: Extracting libacl1...
I: Extracting libattr1...
I: Extracting libaudit-common...
I: Extracting libaudit1...
I: Extracting base-files...
I: Extracting base-passwd...
I: Extracting bash...
I: Extracting libbz2-1.0...
I: Extracting libdebconfclient0...
I: Extracting coreutils...
I: Extracting dash...
I: Extracting libdb5.3...
I: Extracting debconf...
I: Extracting debianutils...
I: Extracting diffutils...
I: Extracting dpkg...
I: Extracting e2fslibs...
I: Extracting e2fsprogs...
I: Extracting libcomerr2...
I: Extracting libss2...
I: Extracting findutils...
I: Extracting gcc-6-base...
I: Extracting libgcc1...
I: Extracting libc-bin...
I: Extracting libc6...
I: Extracting multiarch-support...
I: Extracting grep...
I: Extracting gzip...
I: Extracting hostname...
I: Extracting init-system-helpers...
I: Extracting libcap-ng0...
I: Extracting libgcrypt20...
I: Extracting libgpg-error0...
I: Extracting libselinux1...
I: Extracting libsemanage-common...
I: Extracting libsemanage1...
I: Extracting libsepol1...
I: Extracting lsb-base...
I: Extracting liblz4-1...
I: Extracting mawk...
I: Extracting libncursesw5...
I: Extracting libtinfo5...
I: Extracting ncurses-base...
I: Extracting ncurses-bin...
I: Extracting libpam-modules...
I: Extracting libpam-modules-bin...
I: Extracting libpam-runtime...
I: Extracting libpam0g...
I: Extracting libpcre3...
I: Extracting perl-base...
I: Extracting sed...
I: Extracting sensible-utils...
I: Extracting login...
I: Extracting passwd...
I: Extracting libsystemd0...
I: Extracting libudev1...
I: Extracting sysvinit-utils...
I: Extracting tar...
I: Extracting tzdata...
I: Extracting libustr-1.0-1...
I: Extracting bsdutils...
I: Extracting libblkid1...
I: Extracting libfdisk1...
I: Extracting libmount1...
I: Extracting libsmartcols1...
I: Extracting libuuid1...
I: Extracting mount...
I: Extracting util-linux...
I: Extracting liblzma5...
I: Extracting zlib1g...
W: Failure trying to run: chroot /home/simon/chroot/debian-stretch dpkg-deb -f /var/cache/apt/archives/dpkg_1.18.24_amd64.deb Version
W: See /home/simon/chroot/debian-stretch/debootstrap/debootstrap.log for details
W: Failure trying to run: chroot /home/simon/chroot/debian-stretch mount -t proc proc /proc
W: See /home/simon/chroot/debian-stretch/debootstrap/debootstrap.log for details

Le chroot est maintenant fonctionnel, on peut démarrer bash dedans :

# chroot chroot/debian-stretch /bin/bash 

Pour sortir, on peut simplement faire exit :

# exit

Ubuntu Zesty

Après avoir tout installé, je me retrouve avec une ubuntu zesty non fonctionnelle. En effet, les fichiers /etc/passwd et /etc/groups manquent. J'ai supprimé toute l'installation, il faudra que je réassaye.

[root@localhost chroot]# debootstrap --arch=amd64 --include=locales-all zesty /home/simon/chroot/zesty/ http://archive.ubuntu.com/ubuntu/

Cliquez pour afficher ⇲

Cliquez pour masquer ⇱

I: Retrieving InRelease 
I: Checking Release signature
I: Valid Release signature (key id 790BC7277767219C42C86F933B4FE6ACC0B21F32)
I: Retrieving Packages 
I: Validating Packages 
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Checking component main on http://archive.ubuntu.com/ubuntu...
E: Couldn't find these debs: locales-all
[root@localhost chroot]# debootstrap --arch=amd64 --include=locales zesty /home/simon/chroot/zesty/ http://archive.ubuntu.com/ubuntu/
I: Retrieving InRelease 
I: Checking Release signature
I: Valid Release signature (key id 790BC7277767219C42C86F933B4FE6ACC0B21F32)
I: Validating Packages 
I: Resolving dependencies of required packages...
I: Resolving dependencies of base packages...
I: Checking component main on http://archive.ubuntu.com/ubuntu...
I: Retrieving adduser 3.113+nmu3ubuntu5
I: Validating adduser 3.113+nmu3ubuntu5
I: Retrieving apt 1.4
I: Validating apt 1.4
I: Retrieving apt-utils 1.4
I: Validating apt-utils 1.4
I: Retrieving base-files 9.6ubuntu13
I: Validating base-files 9.6ubuntu13
I: Retrieving base-passwd 3.5.43
I: Validating base-passwd 3.5.43
I: Retrieving bash 4.4-2ubuntu1
I: Validating bash 4.4-2ubuntu1
I: Retrieving bsdutils 1:2.29-1ubuntu2
I: Validating bsdutils 1:2.29-1ubuntu2
I: Retrieving busybox-initramfs 1:1.22.0-19ubuntu2
I: Validating busybox-initramfs 1:1.22.0-19ubuntu2
I: Retrieving bzip2 1.0.6-8.1
I: Validating bzip2 1.0.6-8.1
I: Retrieving console-setup 1.142ubuntu5
I: Validating console-setup 1.142ubuntu5
I: Retrieving console-setup-linux 1.142ubuntu5
I: Validating console-setup-linux 1.142ubuntu5
I: Retrieving coreutils 8.26-3ubuntu3
I: Validating coreutils 8.26-3ubuntu3
I: Retrieving cpio 2.11+dfsg-6
I: Validating cpio 2.11+dfsg-6
I: Retrieving cron 3.0pl1-128ubuntu2
I: Validating cron 3.0pl1-128ubuntu2
I: Retrieving dash 0.5.8-2.3ubuntu1
I: Validating dash 0.5.8-2.3ubuntu1
I: Retrieving dbus 1.10.10-1ubuntu2
I: Validating dbus 1.10.10-1ubuntu2
I: Retrieving debconf 1.5.59ubuntu1
I: Validating debconf 1.5.59ubuntu1
I: Retrieving debconf-i18n 1.5.59ubuntu1
I: Validating debconf-i18n 1.5.59ubuntu1
I: Retrieving debianutils 4.8.1
I: Validating debianutils 4.8.1
I: Retrieving dh-python 2.20170125
I: Validating dh-python 2.20170125
I: Retrieving diffutils 1:3.5-3
I: Validating diffutils 1:3.5-3
I: Retrieving dirmngr 2.1.15-1ubuntu7
I: Validating dirmngr 2.1.15-1ubuntu7
I: Retrieving distro-info-data 0.33
I: Validating distro-info-data 0.33
I: Retrieving dmsetup 2:1.02.136-1ubuntu5
I: Validating dmsetup 2:1.02.136-1ubuntu5
I: Retrieving dpkg 1.18.10ubuntu2
I: Validating dpkg 1.18.10ubuntu2
I: Retrieving e2fslibs 1.43.4-2
I: Validating e2fslibs 1.43.4-2
I: Retrieving e2fsprogs 1.43.4-2
I: Validating e2fsprogs 1.43.4-2
I: Retrieving eject 2.1.5+deb1+cvs20081104-13.2
I: Validating eject 2.1.5+deb1+cvs20081104-13.2
I: Retrieving file 1:5.29-3
I: Validating file 1:5.29-3
I: Retrieving findutils 4.6.0+git+20161106-2
I: Validating findutils 4.6.0+git+20161106-2
I: Retrieving gcc-6-base 6.3.0-12ubuntu2
I: Validating gcc-6-base 6.3.0-12ubuntu2
I: Retrieving gnupg 2.1.15-1ubuntu7
I: Validating gnupg 2.1.15-1ubuntu7
I: Retrieving gnupg-agent 2.1.15-1ubuntu7
I: Validating gnupg-agent 2.1.15-1ubuntu7
I: Retrieving gnupg-l10n 2.1.15-1ubuntu7
I: Validating gnupg-l10n 2.1.15-1ubuntu7
I: Retrieving gpgv 2.1.15-1ubuntu7
I: Validating gpgv 2.1.15-1ubuntu7
I: Retrieving grep 2.27-2
I: Validating grep 2.27-2
I: Retrieving gzip 1.6-4ubuntu1
I: Validating gzip 1.6-4ubuntu1
I: Retrieving hostname 3.18
I: Validating hostname 3.18
I: Retrieving ifupdown 0.8.16ubuntu1
I: Validating ifupdown 0.8.16ubuntu1
I: Retrieving init 1.47
I: Validating init 1.47
I: Retrieving init-system-helpers 1.47
I: Validating init-system-helpers 1.47
I: Retrieving initramfs-tools 0.125ubuntu9
I: Validating initramfs-tools 0.125ubuntu9
I: Retrieving initramfs-tools-bin 0.125ubuntu9
I: Validating initramfs-tools-bin 0.125ubuntu9
I: Retrieving initramfs-tools-core 0.125ubuntu9
I: Validating initramfs-tools-core 0.125ubuntu9
I: Retrieving iproute2 4.9.0-1ubuntu1
I: Validating iproute2 4.9.0-1ubuntu1
I: Retrieving iputils-ping 3:20161105-1ubuntu2
I: Validating iputils-ping 3:20161105-1ubuntu2
I: Retrieving isc-dhcp-client 4.3.5-3ubuntu1
I: Validating isc-dhcp-client 4.3.5-3ubuntu1
I: Retrieving isc-dhcp-common 4.3.5-3ubuntu1
I: Validating isc-dhcp-common 4.3.5-3ubuntu1
I: Retrieving kbd 2.0.3-2ubuntu3
I: Validating kbd 2.0.3-2ubuntu3
I: Retrieving keyboard-configuration 1.142ubuntu5
I: Validating keyboard-configuration 1.142ubuntu5
I: Retrieving klibc-utils 2.0.4-8ubuntu4
I: Validating klibc-utils 2.0.4-8ubuntu4
I: Retrieving kmod 22-1.1ubuntu1
I: Validating kmod 22-1.1ubuntu1
I: Retrieving less 481-2.1ubuntu2
I: Validating less 481-2.1ubuntu2
I: Retrieving libacl1 2.2.52-3
I: Validating libacl1 2.2.52-3
I: Retrieving libapparmor1 2.11.0-2ubuntu4
I: Validating libapparmor1 2.11.0-2ubuntu4
I: Retrieving libapt-inst2.0 1.4
I: Validating libapt-inst2.0 1.4
I: Retrieving libapt-pkg5.0 1.4
I: Validating libapt-pkg5.0 1.4
I: Retrieving libasn1-8-heimdal 7.1.0+dfsg-9ubuntu1
I: Validating libasn1-8-heimdal 7.1.0+dfsg-9ubuntu1
I: Retrieving libassuan0 2.4.3-2
I: Validating libassuan0 2.4.3-2
I: Retrieving libatm1 1:2.5.1-2
I: Validating libatm1 1:2.5.1-2
I: Retrieving libattr1 1:2.4.47-2
I: Validating libattr1 1:2.4.47-2
I: Retrieving libaudit-common 1:2.6.6-1ubuntu1
I: Validating libaudit-common 1:2.6.6-1ubuntu1
I: Retrieving libaudit1 1:2.6.6-1ubuntu1
I: Validating libaudit1 1:2.6.6-1ubuntu1
I: Retrieving libblkid1 2.29-1ubuntu2
I: Validating libblkid1 2.29-1ubuntu2
I: Retrieving libbsd0 0.8.3-1
I: Validating libbsd0 0.8.3-1
I: Retrieving libbz2-1.0 1.0.6-8.1
I: Validating libbz2-1.0 1.0.6-8.1
I: Retrieving libc-bin 2.24-9ubuntu2
I: Validating libc-bin 2.24-9ubuntu2
I: Retrieving libc6 2.24-9ubuntu2
I: Validating libc6 2.24-9ubuntu2
I: Retrieving libcap-ng0 0.7.7-3
I: Validating libcap-ng0 0.7.7-3
I: Retrieving libcap2 1:2.25-1
I: Validating libcap2 1:2.25-1
I: Retrieving libcap2-bin 1:2.25-1
I: Validating libcap2-bin 1:2.25-1
I: Retrieving libcomerr2 1.43.4-2
I: Validating libcomerr2 1.43.4-2
I: Retrieving libcryptsetup4 2:1.7.2-0ubuntu1
I: Validating libcryptsetup4 2:1.7.2-0ubuntu1
I: Retrieving libdb5.3 5.3.28-12
I: Validating libdb5.3 5.3.28-12
I: Retrieving libdbus-1-3 1.10.10-1ubuntu2
I: Validating libdbus-1-3 1.10.10-1ubuntu2
I: Retrieving libdebconfclient0 0.213ubuntu1
I: Validating libdebconfclient0 0.213ubuntu1
I: Retrieving libdevmapper1.02.1 2:1.02.136-1ubuntu5
I: Validating libdevmapper1.02.1 2:1.02.136-1ubuntu5
I: Retrieving libdns-export162 1:9.10.3.dfsg.P4-10.1ubuntu4
I: Validating libdns-export162 1:9.10.3.dfsg.P4-10.1ubuntu4
I: Retrieving libelf1 0.166-2ubuntu1
I: Validating libelf1 0.166-2ubuntu1
I: Retrieving libestr0 0.1.10-2
I: Validating libestr0 0.1.10-2
I: Retrieving libexpat1 2.2.0-2
I: Validating libexpat1 2.2.0-2
I: Retrieving libfdisk1 2.29-1ubuntu2
I: Validating libfdisk1 2.29-1ubuntu2
I: Retrieving libffi6 3.2.1-6
I: Validating libffi6 3.2.1-6
I: Retrieving libfribidi0 0.19.7-1
I: Validating libfribidi0 0.19.7-1
I: Retrieving libgcc1 1:6.3.0-12ubuntu2
I: Validating libgcc1 1:6.3.0-12ubuntu2
I: Retrieving libgcrypt20 1.7.6-1
I: Validating libgcrypt20 1.7.6-1
I: Retrieving libgmp10 2:6.1.2+dfsg-1
I: Validating libgmp10 2:6.1.2+dfsg-1
I: Retrieving libgnutls30 3.5.6-4ubuntu4
I: Validating libgnutls30 3.5.6-4ubuntu4
I: Retrieving libgpg-error0 1.26-2
I: Validating libgpg-error0 1.26-2
I: Retrieving libgssapi3-heimdal 7.1.0+dfsg-9ubuntu1
I: Validating libgssapi3-heimdal 7.1.0+dfsg-9ubuntu1
I: Retrieving libhcrypto4-heimdal 7.1.0+dfsg-9ubuntu1
I: Validating libhcrypto4-heimdal 7.1.0+dfsg-9ubuntu1
I: Retrieving libheimbase1-heimdal 7.1.0+dfsg-9ubuntu1
I: Validating libheimbase1-heimdal 7.1.0+dfsg-9ubuntu1
I: Retrieving libheimntlm0-heimdal 7.1.0+dfsg-9ubuntu1
I: Validating libheimntlm0-heimdal 7.1.0+dfsg-9ubuntu1
I: Retrieving libhogweed4 3.3-1
I: Validating libhogweed4 3.3-1
I: Retrieving libhx509-5-heimdal 7.1.0+dfsg-9ubuntu1
I: Validating libhx509-5-heimdal 7.1.0+dfsg-9ubuntu1
I: Retrieving libidn11 1.33-1
I: Validating libidn11 1.33-1
I: Retrieving libip4tc0 1.6.0-3ubuntu2
I: Validating libip4tc0 1.6.0-3ubuntu2
I: Retrieving libisc-export160 1:9.10.3.dfsg.P4-10.1ubuntu4
I: Validating libisc-export160 1:9.10.3.dfsg.P4-10.1ubuntu4
I: Retrieving libjson-c3 0.12.1-1.1
I: Validating libjson-c3 0.12.1-1.1
I: Retrieving libklibc 2.0.4-8ubuntu4
I: Validating libklibc 2.0.4-8ubuntu4
I: Retrieving libkmod2 22-1.1ubuntu1
I: Validating libkmod2 22-1.1ubuntu1
I: Retrieving libkrb5-26-heimdal 7.1.0+dfsg-9ubuntu1
I: Validating libkrb5-26-heimdal 7.1.0+dfsg-9ubuntu1
I: Retrieving libksba8 1.3.5-2
I: Validating libksba8 1.3.5-2
I: Retrieving libldap-2.4-2 2.4.44+dfsg-3ubuntu2
I: Validating libldap-2.4-2 2.4.44+dfsg-3ubuntu2
I: Retrieving libldap-common 2.4.44+dfsg-3ubuntu2
I: Validating libldap-common 2.4.44+dfsg-3ubuntu2
I: Retrieving liblocale-gettext-perl 1.07-3build1
I: Validating liblocale-gettext-perl 1.07-3build1
I: Retrieving liblz4-1 0.0~r131-2ubuntu2
I: Validating liblz4-1 0.0~r131-2ubuntu2
I: Retrieving liblzma5 5.2.2-1.2
I: Validating liblzma5 5.2.2-1.2
I: Retrieving libmagic-mgc 1:5.29-3
I: Validating libmagic-mgc 1:5.29-3
I: Retrieving libmagic1 1:5.29-3
I: Validating libmagic1 1:5.29-3
I: Retrieving libmnl0 1.0.4-2
I: Validating libmnl0 1.0.4-2
I: Retrieving libmount1 2.29-1ubuntu2
I: Validating libmount1 2.29-1ubuntu2
I: Retrieving libmpdec2 2.4.2-1
I: Validating libmpdec2 2.4.2-1
I: Retrieving libncurses5 6.0+20160625-1ubuntu1
I: Validating libncurses5 6.0+20160625-1ubuntu1
I: Retrieving libncursesw5 6.0+20160625-1ubuntu1
I: Validating libncursesw5 6.0+20160625-1ubuntu1
I: Retrieving libnettle6 3.3-1
I: Validating libnettle6 3.3-1
I: Retrieving libnewt0.52 0.52.18-3ubuntu1
I: Validating libnewt0.52 0.52.18-3ubuntu1
I: Retrieving libnpth0 1.3-1
I: Validating libnpth0 1.3-1
I: Retrieving libp11-kit0 0.23.3-5
I: Validating libp11-kit0 0.23.3-5
I: Retrieving libpam-cap 1:2.25-1
I: Validating libpam-cap 1:2.25-1
I: Retrieving libpam-modules 1.1.8-3.2ubuntu2
I: Validating libpam-modules 1.1.8-3.2ubuntu2
I: Retrieving libpam-modules-bin 1.1.8-3.2ubuntu2
I: Validating libpam-modules-bin 1.1.8-3.2ubuntu2
I: Retrieving libpam-runtime 1.1.8-3.2ubuntu2
I: Validating libpam-runtime 1.1.8-3.2ubuntu2
I: Retrieving libpam-systemd 232-21ubuntu2
I: Validating libpam-systemd 232-21ubuntu2
I: Retrieving libpam0g 1.1.8-3.2ubuntu2
I: Validating libpam0g 1.1.8-3.2ubuntu2
I: Retrieving libpcre3 2:8.39-3
I: Validating libpcre3 2:8.39-3
I: Retrieving libpopt0 1.16-10
I: Validating libpopt0 1.16-10
I: Retrieving libprocps6 2:3.3.12-1ubuntu2
I: Validating libprocps6 2:3.3.12-1ubuntu2
I: Retrieving libpython3-stdlib 3.5.3-1
I: Validating libpython3-stdlib 3.5.3-1
I: Retrieving libpython3.5-minimal 3.5.3-1
I: Validating libpython3.5-minimal 3.5.3-1
I: Retrieving libpython3.5-stdlib 3.5.3-1
I: Validating libpython3.5-stdlib 3.5.3-1
I: Retrieving libreadline7 7.0-0ubuntu2
I: Validating libreadline7 7.0-0ubuntu2
I: Retrieving libroken18-heimdal 7.1.0+dfsg-9ubuntu1
I: Validating libroken18-heimdal 7.1.0+dfsg-9ubuntu1
I: Retrieving libsasl2-2 2.1.27~101-g0780600+dfsg-2ubuntu1
I: Validating libsasl2-2 2.1.27~101-g0780600+dfsg-2ubuntu1
I: Retrieving libsasl2-modules 2.1.27~101-g0780600+dfsg-2ubuntu1
I: Validating libsasl2-modules 2.1.27~101-g0780600+dfsg-2ubuntu1
I: Retrieving libsasl2-modules-db 2.1.27~101-g0780600+dfsg-2ubuntu1
I: Validating libsasl2-modules-db 2.1.27~101-g0780600+dfsg-2ubuntu1
I: Retrieving libseccomp2 2.3.1-2.1ubuntu1
I: Validating libseccomp2 2.3.1-2.1ubuntu1
I: Retrieving libselinux1 2.6-3
I: Validating libselinux1 2.6-3
I: Retrieving libsemanage-common 2.6-2
I: Validating libsemanage-common 2.6-2
I: Retrieving libsemanage1 2.6-2
I: Validating libsemanage1 2.6-2
I: Retrieving libsepol1 2.6-2
I: Validating libsepol1 2.6-2
I: Retrieving libslang2 2.3.1-5ubuntu1
I: Validating libslang2 2.3.1-5ubuntu1
I: Retrieving libsmartcols1 2.29-1ubuntu2
I: Validating libsmartcols1 2.29-1ubuntu2
I: Retrieving libsqlite3-0 3.16.2-3
I: Validating libsqlite3-0 3.16.2-3
I: Retrieving libss2 1.43.4-2
I: Validating libss2 1.43.4-2
I: Retrieving libssl1.0.0 1.0.2g-1ubuntu11
I: Validating libssl1.0.0 1.0.2g-1ubuntu11
I: Retrieving libstdc++6 6.3.0-12ubuntu2
I: Validating libstdc++6 6.3.0-12ubuntu2
I: Retrieving libsystemd0 232-21ubuntu2
I: Validating libsystemd0 232-21ubuntu2
I: Retrieving libtasn1-6 4.10-1
I: Validating libtasn1-6 4.10-1
I: Retrieving libtext-charwidth-perl 0.04-7build6
I: Validating libtext-charwidth-perl 0.04-7build6
I: Retrieving libtext-iconv-perl 1.7-5build5
I: Validating libtext-iconv-perl 1.7-5build5
I: Retrieving libtext-wrapi18n-perl 0.06-7.1
I: Validating libtext-wrapi18n-perl 0.06-7.1
I: Retrieving libtinfo5 6.0+20160625-1ubuntu1
I: Validating libtinfo5 6.0+20160625-1ubuntu1
I: Retrieving libudev1 232-21ubuntu2
I: Validating libudev1 232-21ubuntu2
I: Retrieving libustr-1.0-1 1.0.4-6
I: Validating libustr-1.0-1 1.0.4-6
I: Retrieving libuuid1 2.29-1ubuntu2
I: Validating libuuid1 2.29-1ubuntu2
I: Retrieving libwind0-heimdal 7.1.0+dfsg-9ubuntu1
I: Validating libwind0-heimdal 7.1.0+dfsg-9ubuntu1
I: Retrieving libxtables11 1.6.0-3ubuntu2
I: Validating libxtables11 1.6.0-3ubuntu2
I: Retrieving linux-base 4.0ubuntu1
I: Validating linux-base 4.0ubuntu1
I: Retrieving locales 2.24-9ubuntu2
I: Validating locales 2.24-9ubuntu2
I: Retrieving login 1:4.2-3.2ubuntu1
I: Validating login 1:4.2-3.2ubuntu1
I: Retrieving logrotate 3.8.7-2ubuntu3
I: Validating logrotate 3.8.7-2ubuntu3
I: Retrieving lsb-base 9.20160110ubuntu5
I: Validating lsb-base 9.20160110ubuntu5
I: Retrieving lsb-release 9.20160110ubuntu5
I: Validating lsb-release 9.20160110ubuntu5
I: Retrieving mawk 1.3.3-17ubuntu2
I: Validating mawk 1.3.3-17ubuntu2
I: Retrieving mime-support 3.60ubuntu1
I: Validating mime-support 3.60ubuntu1
I: Retrieving mount 2.29-1ubuntu2
I: Validating mount 2.29-1ubuntu2
I: Retrieving multiarch-support 2.24-9ubuntu2
I: Validating multiarch-support 2.24-9ubuntu2
I: Retrieving ncurses-base 6.0+20160625-1ubuntu1
I: Validating ncurses-base 6.0+20160625-1ubuntu1
I: Retrieving ncurses-bin 6.0+20160625-1ubuntu1
I: Validating ncurses-bin 6.0+20160625-1ubuntu1
I: Retrieving netbase 5.4
I: Validating netbase 5.4
I: Retrieving netcat-openbsd 1.130-3
I: Validating netcat-openbsd 1.130-3
I: Retrieving passwd 1:4.2-3.2ubuntu1
I: Validating passwd 1:4.2-3.2ubuntu1
I: Retrieving perl-base 5.24.1-2ubuntu1
I: Validating perl-base 5.24.1-2ubuntu1
I: Retrieving pinentry-curses 1.0.0-2
I: Validating pinentry-curses 1.0.0-2
I: Retrieving procps 2:3.3.12-1ubuntu2
I: Validating procps 2:3.3.12-1ubuntu2
I: Retrieving python3 3.5.3-1
I: Validating python3 3.5.3-1
I: Retrieving python3-minimal 3.5.3-1
I: Validating python3-minimal 3.5.3-1
I: Retrieving python3.5 3.5.3-1
I: Validating python3.5 3.5.3-1
I: Retrieving python3.5-minimal 3.5.3-1
I: Validating python3.5-minimal 3.5.3-1
I: Retrieving readline-common 7.0-0ubuntu2
I: Validating readline-common 7.0-0ubuntu2
I: Retrieving resolvconf 1.79ubuntu4
I: Validating resolvconf 1.79ubuntu4
I: Retrieving rsyslog 8.16.0-1ubuntu5
I: Validating rsyslog 8.16.0-1ubuntu5
I: Retrieving sed 4.4-1
I: Validating sed 4.4-1
I: Retrieving sensible-utils 0.0.9
I: Validating sensible-utils 0.0.9
I: Retrieving sudo 1.8.19p1-1ubuntu1
I: Validating sudo 1.8.19p1-1ubuntu1
I: Retrieving systemd 232-21ubuntu2
I: Validating systemd 232-21ubuntu2
I: Retrieving systemd-sysv 232-21ubuntu2
I: Validating systemd-sysv 232-21ubuntu2
I: Retrieving sysvinit-utils 2.88dsf-59.8git1
I: Validating sysvinit-utils 2.88dsf-59.8git1
I: Retrieving tar 1.29b-1.1
I: Validating tar 1.29b-1.1
I: Retrieving tzdata 2017b-1
I: Validating tzdata 2017b-1
I: Retrieving ubuntu-keyring 2016.10.27
I: Validating ubuntu-keyring 2016.10.27
I: Retrieving ubuntu-minimal 1.379
I: Validating ubuntu-minimal 1.379
I: Retrieving ucf 3.0036
I: Validating ucf 3.0036
I: Retrieving udev 232-21ubuntu2
I: Validating udev 232-21ubuntu2
I: Retrieving util-linux 2.29-1ubuntu2
I: Validating util-linux 2.29-1ubuntu2
I: Retrieving vim-common 2:8.0.0095-1ubuntu3
I: Validating vim-common 2:8.0.0095-1ubuntu3
I: Retrieving vim-tiny 2:8.0.0095-1ubuntu3
I: Validating vim-tiny 2:8.0.0095-1ubuntu3
I: Retrieving whiptail 0.52.18-3ubuntu1
I: Validating whiptail 0.52.18-3ubuntu1
I: Retrieving xkb-data 2.19-1ubuntu1
I: Validating xkb-data 2.19-1ubuntu1
I: Retrieving xxd 2:8.0.0095-1ubuntu3
I: Validating xxd 2:8.0.0095-1ubuntu3
I: Retrieving xz-utils 5.2.2-1.2
I: Validating xz-utils 5.2.2-1.2
I: Retrieving zlib1g 1:1.2.11.dfsg-0ubuntu1
I: Validating zlib1g 1:1.2.11.dfsg-0ubuntu1
I: Chosen extractor for .deb packages: ar
I: Extracting base-files...
I: Extracting base-passwd...
I: Extracting bash...
I: Extracting bsdutils...
I: Extracting coreutils...
I: Extracting dash...
I: Extracting debconf...
I: Extracting debianutils...
I: Extracting diffutils...
I: Extracting dpkg...
I: Extracting e2fslibs...
I: Extracting e2fsprogs...
I: Extracting findutils...
I: Extracting gcc-6-base...
I: Extracting grep...
I: Extracting gzip...
I: Extracting hostname...
I: Extracting init-system-helpers...
I: Extracting libacl1...
I: Extracting libattr1...
I: Extracting libaudit-common...
I: Extracting libaudit1...
I: Extracting libblkid1...
I: Extracting libbz2-1.0...
I: Extracting libc-bin...
I: Extracting libc6...
I: Extracting libcap-ng0...
I: Extracting libcomerr2...
I: Extracting libdb5.3...
I: Extracting libdebconfclient0...
I: Extracting libfdisk1...
I: Extracting libgcc1...
I: Extracting libgcrypt20...
I: Extracting libgpg-error0...
I: Extracting liblz4-1...
I: Extracting liblzma5...
I: Extracting libmount1...
I: Extracting libncurses5...
I: Extracting libncursesw5...
I: Extracting libpam-modules...
I: Extracting libpam-modules-bin...
I: Extracting libpam-runtime...
I: Extracting libpam0g...
I: Extracting libpcre3...
I: Extracting libprocps6...
I: Extracting libselinux1...
I: Extracting libsemanage-common...
I: Extracting libsemanage1...
I: Extracting libsepol1...
I: Extracting libsmartcols1...
I: Extracting libss2...
I: Extracting libsystemd0...
I: Extracting libtinfo5...
I: Extracting libudev1...
I: Extracting libustr-1.0-1...
I: Extracting libuuid1...
I: Extracting login...
I: Extracting lsb-base...
I: Extracting mawk...
I: Extracting mount...
I: Extracting multiarch-support...
I: Extracting ncurses-base...
I: Extracting ncurses-bin...
I: Extracting passwd...
I: Extracting perl-base...
I: Extracting procps...
I: Extracting sed...
I: Extracting sensible-utils...
I: Extracting sysvinit-utils...
I: Extracting tar...
I: Extracting util-linux...
I: Extracting zlib1g...
W: Failure trying to run: chroot /home/simon/chroot/zesty mount -t proc proc /proc
W: See /home/simon/chroot/zesty/debootstrap/debootstrap.log for details

Configurations supplémentaires

On crée un script bash pour lancer le chroot tout en montant les dossier sys, dev et proc :

# vim launch-debian-stretch.sh

Contenu :

#!/bin/bash
 
cd /home/simon/chroot/debian-stretch
sudo mount --bind /proc proc
sudo mount --bind /sys sys
sudo mount --rbind /dev dev
sudo chroot . /bin/bash
sudo umount sys
sudo umount proc
sudo umount dev

On rend le script exécutable :

# chmod +x launch-debian-stretch.sh

Avant de lancer le script, on peut regarder le contenu du dossier /sys/ sur la racine principale :

root@laptop:/home/simon/chroot# ls /sys/
block  bus  class  dev	devices  firmware  fs  hypervisor  kernel  module  power

On peut regarder le contenu du dossier /sys/ sur la racine du chroot, avant d'utiliser le script pour se connecter.

root@laptop:/home/simon/chroot# ls debian-stretch/sys/

Et si on lance notre script, on entre dans la racine du chroot et on peut voir que les dossiers /sys/ et /proc/ sont bien montés :

root@laptop:/home/simon/chroot# ./debian-stretch.sh 
 
root@laptop:/# ls /sys/
block  bus  class  dev	devices  firmware  fs  hypervisor  kernel  module  power
root@laptop:/# ls -l /proc/
total 0
dr-xr-xr-x  9 root             root                           0 oct 10 07:49 1
dr-xr-xr-x  9 root             root                           0 oct 11 11:37 10
dr-xr-xr-x  9 root             root                           0 oct 11 11:37 100
dr-xr-xr-x  9             1000             1000               0 oct 11 11:37 1003
(...)

Problèmes rencontrés

Sauvegarder / Restaurer un "chroot"

On utilise la commande tar pour sauvegarder (et compresser) un “chroot” puis le restaurer :

# tar czvf < nom_archive >.tar.gz < nom_rep >
tar xzvf < nom_archive >.tar.gz

sudo qui ne fonctionne pas

Pour odoo, j'ai installé sudo et à la première utilisation, j'ai eu cette erreur :

$ sudo vim /etc/hostname 
sudo: pas de tty présent et pas de programme askpass spécifié

Solution (trouvée sur stackoverflow) :

sudo -S true

Sources