[SOLVED] chroot: failed to run command ‘/tools/bin/env’: No such file or directory: chapter 6.4
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
is there anywhere that I could search to find the answer to this? I have been looking around and cannot find anything useful :|. thanks again for all your help!
Okay. I believe this is going to turn out to be something simple. And even though you have started over "many times", you could be doing the same wrong thing "many times". For example, you've rebooted. And you repeated the steps in 6.2 concerning the virtual kernel filesystems. But did you remember to remount the partition at /mnt/lfs before doing all that? Since your post didn't mention that, it's at least possible to have done those repeated steps in the mount point in the host system instead in the LFS partition. Some harmless things to try...
1. Change to root like the book says (you don't need to use sudo with the lfs user for entering chroot).
2. Unmount /mnt/lfs.
Code:
umount -v /mnt/lfs
3. Look at /mnt/lfs (it should be empty while umounted)
Code:
ls /mnt/lfs
4. Check that the LFS variable is "/mnt/lfs". Export it again if it is null or not right.
Code:
echo $LFS
5. Remount the LFS partition.
Code:
mount -v /dev/<xxx> $LFS
6. Just for fun, try just running the env executable in /tools. It should list some variables.
Code:
$LFS/tools/bin/env
7. If you make it this far, now redo the virtual filesystem stuff.
Code:
mkdir -pv $LFS/{dev,proc,sys,run}
mknod -m 600 $LFS/dev/console c 5 1
mknod -m 666 $LFS/dev/null c 1 3
mount -v --bind /dev $LFS/dev
mount -vt devpts devpts $LFS/dev/pts -o gid=5,mode=620
mount -vt proc proc $LFS/proc
mount -vt sysfs sysfs $LFS/sys
mount -vt tmpfs tmpfs $LFS/run
if [ -h $LFS/dev/shm ]; then
mkdir -pv $LFS/$(readlink $LFS/dev/shm)
fi
If this didn't go anywhere, then no harm done. And maybe it's not such a simple thing after all. But in closing I'll say this: the LFS book is right about things like this. Follow the book (and nothing else). I don't remember about 7.8, but there are no published errata for the current stable version. Copy and paste instead of hand typing.
So I guess you established that /mnt/lfs/tools/bin/env runs in the host system but not in the chroot environment. Something it (and maybe a bunch of others) needs is not there.
You used that old tutorial at least some. Just for fun, run the library-check.sh script found in the book (Host System Requirements).
P.S.: I would ditch that old tutorial. The book is all you need.
thanks for your help. I just reinstalled ubuntu, This time I installed ubuntu 14. I think that is the problem (earlier I was running ubuntu 16). I do not know why this is but that seemed to work for me.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.