简体   繁体   中英

/usr/bin/env: python3.3: No such file or directory inside chroot

chroot --userspec 1000:1000 /var/lib/broot/sugar-build-3xlQJ /usr/bin/env -i 
PATH=/bin:  /usr/bin:/usr/sbin BROOT=yes XAUTHORITY=/home/broot/.Xauthority 
DISPLAY=:0 HOME=/home/broot LANG=C TERM=xterm-256color  
/bin/bash -lc "/home/broot/sugar-build/osbuild build"

can anyone explain the above command because the error seems to be in this only . I know what chroot basically does, so the problem seems to be that the python3.3 module is not in the chroot jail. so if that is the problem , how can i get python3.3 module inside the chroot jail. Btw i am porting some modules from python2.7 to python3.3 and the above command is from those modules and it did work in python2.7.

When you create a chroot environment, everything you need must be copied from your installation.

Let's say your chroot environment starts under /var/chroot.

Let's say further that you want to be able to run "ls" (you don't have if you don't ever need to have the capability to run "ls", but let's say you do). First you must copy /bin/ls to /var/chroot/bin/ls. Now, "/bin/ls" requires a number of library files in order to run.
Let's say you discover one of them is called /lib64/libcap.so. That means you have to copy /lib/libcap.so to /var/chroot/lib64/libcap.so otherwise your /var/chroot/bin/ls will NOT run. You do this for all the libraries that "ls" requires.

After all that is done, you can chroot to /var/chroot, and, voila, your "ls" now runs.

Same idea with any other commands, whether they are system commands such as "ls", or compilers/interpreters such as python.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM