8.6.35.1 Run a different Debian distribution with chroot
A chroot Debian environment can easily be created by the debootstrap command in Sarge. For post-Sarge distributions, you may use cdebootstrap command instead with appropriate option. For example, to create a Sid chroot on /sid-root while having fast Internet access:
main # cd /; mkdir /sid-root
main # debootstrap sid /sid-root http://ftp.debian.org/debian/
... watch it download the whole system
main # echo "proc /sid-root/proc proc none 0 0" >> /etc/fstab
main # mount /sid-root/proc
main # mount /dev/ /sid-root/dev -o bind
main # cp /etc/hosts /sid-root/etc/hosts
main # chroot /sid-root /bin/bash
chroot # cd /dev; /sbin/MAKEDEV generic; cd -
chroot # apt-setup # set-up /etc/apt/sources.list
chroot # vi /etc/apt/sources.list # point the source to unstable
chroot # dselect # you may use aptitude, install mc and vim :-)
At this point you should have a fully working Debian system, where you can play around without fear of affecting your main Debian installation.
This debootstrap trick can also be used to install Debian to a system without using a Debian install disk, but instead one for another GNU/Linux distribution. See http://www.debian.org/releases/stable/i386/apcs04.
http://www.debian.org/doc/manuals/reference/ch-tips.en.html
A chroot Debian environment can easily be created by the debootstrap command in Sarge. For post-Sarge distributions, you may use cdebootstrap command instead with appropriate option. For example, to create a Sid chroot on /sid-root while having fast Internet access:
main # cd /; mkdir /sid-root
main # debootstrap sid /sid-root http://ftp.debian.org/debian/
... watch it download the whole system
main # echo "proc /sid-root/proc proc none 0 0" >> /etc/fstab
main # mount /sid-root/proc
main # mount /dev/ /sid-root/dev -o bind
main # cp /etc/hosts /sid-root/etc/hosts
main # chroot /sid-root /bin/bash
chroot # cd /dev; /sbin/MAKEDEV generic; cd -
chroot # apt-setup # set-up /etc/apt/sources.list
chroot # vi /etc/apt/sources.list # point the source to unstable
chroot # dselect # you may use aptitude, install mc and vim :-)
At this point you should have a fully working Debian system, where you can play around without fear of affecting your main Debian installation.
This debootstrap trick can also be used to install Debian to a system without using a Debian install disk, but instead one for another GNU/Linux distribution. See http://www.debian.org/releases/stable/i386/apcs04.
http://www.debian.org/doc/manuals/reference/ch-tips.en.html
Nincsenek megjegyzések:
Megjegyzés küldése