Debian笔记(3) - chroot环境

main # cd / ; mkdir /sid-root
main # debootstrap sid /sid-root
… watch it download the whole system
main # echo “proc-sid /sid-root/proc proc none 0 0” >> /etc/fstab
main # mount proc-sid /sid-root/proc -t proc
main # cp /etc/hosts /sid-root/etc/hosts
main # chroot /sid-root /bin/bash
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 🙂

debootstrap –exclude=base-config,ipchains,libnewt0.51,libsigc++-1.2-5c102,slang1a-utf8 sid /sid-root
I: Extracting libstdc++5…
mount: error while loading shared libraries: cannot open shared object file: No such file or directory
W: Failure trying to run: chroot /home/qiuyu/sid-root mount -t proc proc /proc
umount: /home/qiuyu/sid-root/dev/pts: not mounted
umount: /home/qiuyu/sid-root/dev/shm: not mounted
umount: /home/qiuyu/sid-root/proc/bus/usb: not found
umount: /home/qiuyu/sid-root/proc: not mounted更新debootstrap版本后继续

可通过chroot sarge-root /usr/bin/env -i HOME=/root TERM=”$TERM” PS1=’\u:\w\$ ‘ PATH=/bin:/usr/bin:/sbin:/usr/sbin /bin/bash –login +h 登录消除环境变量影响


Speak Your Mind

If you want a pic to show with your comment, go get a gravatar!