特殊:Badtitle/NS100:WoodyInChroot:修订间差异
小无编辑摘要 |
小无编辑摘要 |
||
第12行: | 第12行: | ||
* Package debootstrap installed. | * Package debootstrap installed. | ||
<pre><nowiki> | <pre><nowiki> | ||
$ sudo apt-get install debootstrap | $ sudo apt-get install debootstrap | ||
</nowiki></pre> | </nowiki></pre> | ||
== Installing Debian Woody == | == Installing Debian Woody == | ||
Install a base debian woody system into the directory /opt/woody | Install a base debian woody system into the directory /opt/woody | ||
<pre><nowiki> | <pre><nowiki> | ||
$ sudo debootstrap --arch i386 woody /opt/woody http://http.us.debian.org/debian | $ sudo debootstrap --arch i386 woody /opt/woody http://http.us.debian.org/debian | ||
</nowiki></pre> | </nowiki></pre> | ||
chroot into the new environment and install some common X11 packages. | chroot into the new environment and install some common X11 packages. | ||
<pre><nowiki> | <pre><nowiki> | ||
$ sudo mount -t proc proc /opt/woody/proc | $ sudo mount -t proc proc /opt/woody/proc | ||
$ sudo mount --bind /tmp /opt/woody/tmp | $ sudo mount --bind /tmp /opt/woody/tmp | ||
$ sudo mount --bind /dev /opt/woody/dev | $ sudo mount --bind /dev /opt/woody/dev | ||
$ sudo chroot /opt/woody | $ sudo chroot /opt/woody | ||
# apt-get install xterm | # apt-get install xterm | ||
# exit | # exit | ||
$ sudo umount /opt/woody/proc | $ sudo umount /opt/woody/proc | ||
$ sudo umount /opt/woody/tmp | $ sudo umount /opt/woody/tmp | ||
$ sudo umount /opt/woody/dev | $ sudo umount /opt/woody/dev | ||
</nowiki></pre> | </nowiki></pre> | ||
Create woody environment script in /usr/local/bin/woody | Create woody environment script in /usr/local/bin/woody | ||
<pre><nowiki>#!/bin/bash | <pre><nowiki>#!/bin/bash | ||
CHROOT=/opt/woody | CHROOT=/opt/woody | ||
if test "$(whoami)" = "root" ; then | if test "$(whoami)" = "root" ; then | ||
第59行: | 第60行: | ||
Make it executable. | Make it executable. | ||
<pre><nowiki> | <pre><nowiki> | ||
$ chmod a+x /usr/local/bin/woody | $ chmod a+x /usr/local/bin/woody | ||
</nowiki></pre> | </nowiki></pre> | ||
Applications can now be run in the debian woody environment by prefixing their launch command with "woody ". | 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). | Here is the contents of a kohan start script that is saved in /usr/local/bin/kohan (it must also be executable). | ||
<pre><nowiki> | <pre><nowiki> | ||
woody /usr/local/games/kohan/kohan $* | woody /usr/local/games/kohan/kohan $* | ||
</nowiki></pre> | </nowiki></pre> | ||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2007年12月6日 (四) 11:05的版本
文章出处: |
{{#if: | {{{2}}} | https://help.ubuntu.com/community/WoodyInChroot }} |
点击翻译: |
English {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/af | • {{#if: UbuntuHelp:WoodyInChroot|Afrikaans| [[::WoodyInChroot/af|Afrikaans]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/ar | • {{#if: UbuntuHelp:WoodyInChroot|العربية| [[::WoodyInChroot/ar|العربية]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/az | • {{#if: UbuntuHelp:WoodyInChroot|azərbaycanca| [[::WoodyInChroot/az|azərbaycanca]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/bcc | • {{#if: UbuntuHelp:WoodyInChroot|جهلسری بلوچی| [[::WoodyInChroot/bcc|جهلسری بلوچی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/bg | • {{#if: UbuntuHelp:WoodyInChroot|български| [[::WoodyInChroot/bg|български]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/br | • {{#if: UbuntuHelp:WoodyInChroot|brezhoneg| [[::WoodyInChroot/br|brezhoneg]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/ca | • {{#if: UbuntuHelp:WoodyInChroot|català| [[::WoodyInChroot/ca|català]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/cs | • {{#if: UbuntuHelp:WoodyInChroot|čeština| [[::WoodyInChroot/cs|čeština]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/de | • {{#if: UbuntuHelp:WoodyInChroot|Deutsch| [[::WoodyInChroot/de|Deutsch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/el | • {{#if: UbuntuHelp:WoodyInChroot|Ελληνικά| [[::WoodyInChroot/el|Ελληνικά]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/es | • {{#if: UbuntuHelp:WoodyInChroot|español| [[::WoodyInChroot/es|español]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/fa | • {{#if: UbuntuHelp:WoodyInChroot|فارسی| [[::WoodyInChroot/fa|فارسی]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/fi | • {{#if: UbuntuHelp:WoodyInChroot|suomi| [[::WoodyInChroot/fi|suomi]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/fr | • {{#if: UbuntuHelp:WoodyInChroot|français| [[::WoodyInChroot/fr|français]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/gu | • {{#if: UbuntuHelp:WoodyInChroot|ગુજરાતી| [[::WoodyInChroot/gu|ગુજરાતી]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/he | • {{#if: UbuntuHelp:WoodyInChroot|עברית| [[::WoodyInChroot/he|עברית]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/hu | • {{#if: UbuntuHelp:WoodyInChroot|magyar| [[::WoodyInChroot/hu|magyar]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/id | • {{#if: UbuntuHelp:WoodyInChroot|Bahasa Indonesia| [[::WoodyInChroot/id|Bahasa Indonesia]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/it | • {{#if: UbuntuHelp:WoodyInChroot|italiano| [[::WoodyInChroot/it|italiano]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/ja | • {{#if: UbuntuHelp:WoodyInChroot|日本語| [[::WoodyInChroot/ja|日本語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/ko | • {{#if: UbuntuHelp:WoodyInChroot|한국어| [[::WoodyInChroot/ko|한국어]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/ksh | • {{#if: UbuntuHelp:WoodyInChroot|Ripoarisch| [[::WoodyInChroot/ksh|Ripoarisch]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/mr | • {{#if: UbuntuHelp:WoodyInChroot|मराठी| [[::WoodyInChroot/mr|मराठी]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/ms | • {{#if: UbuntuHelp:WoodyInChroot|Bahasa Melayu| [[::WoodyInChroot/ms|Bahasa Melayu]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/nl | • {{#if: UbuntuHelp:WoodyInChroot|Nederlands| [[::WoodyInChroot/nl|Nederlands]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/no | • {{#if: UbuntuHelp:WoodyInChroot|norsk| [[::WoodyInChroot/no|norsk]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/oc | • {{#if: UbuntuHelp:WoodyInChroot|occitan| [[::WoodyInChroot/oc|occitan]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/pl | • {{#if: UbuntuHelp:WoodyInChroot|polski| [[::WoodyInChroot/pl|polski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/pt | • {{#if: UbuntuHelp:WoodyInChroot|português| [[::WoodyInChroot/pt|português]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/ro | • {{#if: UbuntuHelp:WoodyInChroot|română| [[::WoodyInChroot/ro|română]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/ru | • {{#if: UbuntuHelp:WoodyInChroot|русский| [[::WoodyInChroot/ru|русский]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/si | • {{#if: UbuntuHelp:WoodyInChroot|සිංහල| [[::WoodyInChroot/si|සිංහල]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/sq | • {{#if: UbuntuHelp:WoodyInChroot|shqip| [[::WoodyInChroot/sq|shqip]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/sr | • {{#if: UbuntuHelp:WoodyInChroot|српски / srpski| [[::WoodyInChroot/sr|српски / srpski]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/sv | • {{#if: UbuntuHelp:WoodyInChroot|svenska| [[::WoodyInChroot/sv|svenska]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/th | • {{#if: UbuntuHelp:WoodyInChroot|ไทย| [[::WoodyInChroot/th|ไทย]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/tr | • {{#if: UbuntuHelp:WoodyInChroot|Türkçe| [[::WoodyInChroot/tr|Türkçe]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/vi | • {{#if: UbuntuHelp:WoodyInChroot|Tiếng Việt| [[::WoodyInChroot/vi|Tiếng Việt]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/yue | • {{#if: UbuntuHelp:WoodyInChroot|粵語| [[::WoodyInChroot/yue|粵語]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/zh | • {{#if: UbuntuHelp:WoodyInChroot|中文| [[::WoodyInChroot/zh|中文]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/zh-hans | • {{#if: UbuntuHelp:WoodyInChroot|中文(简体)| [[::WoodyInChroot/zh-hans|中文(简体)]]}}|}} {{#ifexist: {{#if: UbuntuHelp:WoodyInChroot | UbuntuHelp:WoodyInChroot | {{#if: | :}}WoodyInChroot}}/zh-hant | • {{#if: UbuntuHelp:WoodyInChroot|中文(繁體)| [[::WoodyInChroot/zh-hant|中文(繁體)]]}}|}} |
{{#ifeq:UbuntuHelp:WoodyInChroot|:WoodyInChroot|请不要直接编辑翻译本页,本页将定期与来源同步。}} |
{{#ifexist: :WoodyInChroot/zh | | {{#ifexist: WoodyInChroot/zh | | {{#ifeq: {{#titleparts:WoodyInChroot|1|-1|}} | zh | | }} }} }} {{#ifeq: {{#titleparts:WoodyInChroot|1|-1|}} | zh | | }}
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.
$ sudo apt-get install debootstrap
Installing Debian Woody
Install a base debian woody system into the directory /opt/woody
$ sudo debootstrap --arch i386 woody /opt/woody http://http.us.debian.org/debian
chroot into the new environment and install some common X11 packages.
$ 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
Create woody environment script in /usr/local/bin/woody
#!/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
Make it executable.
$ chmod a+x /usr/local/bin/woody
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).
woody /usr/local/games/kohan/kohan $*