个人工具
登录
查看“UbuntuHelp:WoodyInChroot”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:WoodyInChroot”的源代码
来自Ubuntu中文
←
UbuntuHelp:WoodyInChroot
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/WoodyInChroot}} {{Languages|UbuntuHelp:WoodyInChroot}} == Motivation == Binary-only applications that were compiled with an earlier libc6 version may be incompatible with a modern ubuntu install. Applications that crash, seg-fault, or exit with an unresolved symbol, but run fine on older linux systems, need an older environment to run. == Overview == This HOWTO will walk through how to create a debian environment that was released in 2002, inside your existing ubuntu system without affecting any of your existing applications or libraries. == Which Applications? == I have used this technique to reduce application crashing with sun-jdk-1.4.2, loki-kohan, and loki-tribes2. Applications that were released as binary-only around 2002 are good candidates for running in a chroot debian woody environment. == Requirements == * chroot requires root access. * About 128 MB of free disk space in /opt. * Package debootstrap installed. <pre><nowiki> $ sudo apt-get install debootstrap </nowiki></pre> == Installing Debian Woody == Install a base debian woody system into the directory /opt/woody <pre><nowiki> $ sudo debootstrap --arch i386 woody /opt/woody http://http.us.debian.org/debian </nowiki></pre> chroot into the new environment and install some common X11 packages. <pre><nowiki> $ sudo mount -t proc proc /opt/woody/proc $ sudo mount --bind /tmp /opt/woody/tmp $ sudo mount --bind /dev /opt/woody/dev $ sudo chroot /opt/woody # apt-get install xterm # exit $ sudo umount /opt/woody/proc $ sudo umount /opt/woody/tmp $ sudo umount /opt/woody/dev </nowiki></pre> Create woody environment script in /usr/local/bin/woody <pre><nowiki> #!/bin/bash CHROOT=/opt/woody if test "$(whoami)" = "root" ; then mount -t proc proc $CHROOT/proc mount --bind /tmp $CHROOT/tmp mount --bind /dev $CHROOT/dev mount --bind /usr/local $CHROOT/usr/local mount --bind /home $CHROOT/home mount --bind /opt $CHROOT/opt cp /etc/passwd /etc/group $CHROOT/etc if test "$*" ; then chroot $CHROOT su $SUDO_USER -c "$*" else chroot $CHROOT su $SUDO_USER fi umount -l $CHROOT/proc umount -l $CHROOT/tmp umount -l $CHROOT/dev umount -l $CHROOT/usr/local umount -l $CHROOT/home umount -l $CHROOT/opt else gksudo "$0 $*" fi </nowiki></pre> Make it executable. <pre><nowiki> $ chmod a+x /usr/local/bin/woody </nowiki></pre> Applications can now be run in the debian woody environment by prefixing their launch command with "woody ". Here is the contents of a kohan start script that is saved in /usr/local/bin/kohan (it must also be executable). <pre><nowiki> woody /usr/local/games/kohan/kohan $* </nowiki></pre> [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:WoodyInChroot
。