chroot: failed to run command '/tools/bin/env': Too many levels of symbolic links
Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
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.
chroot: failed to run command '/tools/bin/env': Too many levels of symbolic links
I am trying to build OS with the help of LFS-8.0,i Have completed till chapter-5 but in 6 i am getting error from 48hr. i tried my best solve it.even still i doing to fix it.But i want to take your experience and guidance.
Error:
root@administrator-Lenovo-U410:/mnt/lfs# chroot "$LFS" /tools/bin/env -i HOME=/root TERM="$TERM" PS1='\u:\w\$ ' PATH=/bin:/usr/bin:/sbin:/usr/sbin:/tools/bin /tools/bin/bash --login +h
chroot: failed to run command '/tools/bin/env': Too many levels of symbolic links
The message seems fairly straight forward about the env command itself.
What do you see if you run "ls -l /tools/bin/env"? "ls -ld /tools/bin"? "ls -ld /tools".
If /tools/bin is a link to /usr/local/tools/bin which and /usr/local is a link to /usr/share and /usr/share is a link to /share etc... it might explain this error. (Of course the links might be anywhere - I'm just illustrating possibilities.) If "env" exists in /bin (as it does on RHEL) and is not a link there then adding /bin to the front of your PATH (before calling env command itself) would likely solve the issue.
The message seems fairly straight forward about the env command itself.
What do you see if you run "ls -l /tools/bin/env"? "ls -ld /tools/bin"? "ls -ld /tools".
If /tools/bin is a link to /usr/local/tools/bin which and /usr/local is a link to /usr/share and /usr/share is a link to /share etc... it might explain this error. (Of course the links might be anywhere - I'm just illustrating possibilities.) If "env" exists in /bin (as it does on RHEL) and is not a link there then adding /bin to the front of your PATH (before calling env command itself) would likely solve the issue.
When you are building LFS, /tools on the host system is a link to $LFS/tools. $LFS/tools is not a link to anything and nor is $LFS/tools/bin; they are simple directories. At this stage in an LFS build, programs on the host are no longer used; everything is done with the new LFS tools in /tools/bin.
As far as I can see, the chroot instruction given by the OP is correct, so I'm not sure what is going wrong here. In addition to your suggestions, it would be worth doing "readlink /tools" in the host system.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.