yaourt -S --nocnofirm --asdeps ubuntu-keyring gnupg1 # , yaourt -S --nocnofirm debootstrap schroot for distr in trusty precise do sudo debootstrap --include=vim,language-pack-ru,language-pack-ru-base,devscripts,subversion,git --arch amd64 $distr /home/ubuntu_$distr http://mirror.yandex.ru/ubuntu/ done
for distr in trusty precise do sudo sh -c "cat > /home/ubuntu_$distr/etc/apt/sources.list <<EOF deb http://mirror.yandex.ru/ubuntu $distr main restricted universe multiverse deb http://mirror.yandex.ru/ubuntu $distr-updates main restricted universe multiverse deb http://mirror.yandex.ru/ubuntu $distr-security main restricted universe multiverse EOF" done
[ubuntu-trusty] description=Ubuntu 14.04 type=directory directory=/home/ubuntu_trusty users=clown,monkey,mrsam root-users=clown aliases=trusty,default profile=ubuntu [ubuntu-precise] description=Ubuntu 12.04 type=directory directory=/home/ubuntu_precise users=clown,monkey,mrsam root-users=clown aliases=precise profile=ubuntu
# System databases to copy into the chroot from the host system. # # <database name> passwd shadow group gshadow services protocols networks hosts
$ cat copyfiles # Files to copy into the chroot from the host system. # # <source and destination> /etc/resolv.conf $ cat fstab # fstab: static file system information for chroots. # Note that the mount point will be prefixed by the chroot path # (CHROOT_PATH) # # <file system> <mount point> <type> <options> <dump> <pass> /proc /proc none rw,bind 0 0 /sys /sys none rw,bind 0 0 /dev /dev none rw,bind 0 0 /dev/pts /dev/pts none rw,bind 0 0 /home /home none rw,bind 0 0 /tmp /tmp none rw,bind 0 0 # It may be desirable to have access to /run, especially if you wish # to run additional services in the chroot. However, note that this # may potentially cause undesirable behaviour on upgrades, such as # killing services on the host. #/run /run none rw,bind 0 0 #/run/lock /run/lock none rw,bind 0 0 #/dev/shm /dev/shm none rw,bind 0 0 #/run/shm /run/shm none rw,bind 0 0 $ cat nssdatabases # System databases to copy into the chroot from the host system. # # <database name> protocols hosts
for distr in trusty precise do sudo cp /etc/locale.gen /home/ubuntu_$distr/var/lib/locales/supported.d/local # etc home , ln -f done
sudo ln -f /home/ubuntu_trusty/etc/bash.bashrc /home/ubuntu_precise/etc/bash.bashrc
apt-mark hold initscripts udev plymouth mountall
sudo locale-gen sudo dpkg-reconfigure tzdata
Source: https://habr.com/ru/post/244373/
All Articles