Debian笔记(3) - chroot环境

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 /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 🙂

从sarge安装chroot环境中的sid时
debootstrap –exclude=base-config,ipchains,libnewt0.51,libsigc++-1.2-5c102,slang1a-utf8 sid /sid-root http://debian.cn99.com/debian/
最终在如下步骤失败,尚未找到解决方案
I: Extracting libstdc++5…
mount: error while loading shared libraries: libdevmapper.so.1.02: 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

http://www.backports.org/更新debootstrap版本后继续
参考:
http://www.debianhelp.org/node/1169
http://forums.debian.net/viewtopic.php?t=7840&sid=ce51f774b45788eb465ce71f771f1e90

sarge安装另一个chroot环境的sarge没有问题
可通过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!