I have a problem with compiling an LFS system on Linux Mint 20 with Cinnamon. My problem is that when I get to the (third?) pass of Glibc, chroot doesn't let me run any commands, telling me that they aren't directories. The exact output of chroot is this:

root@LAPTOP:~# chroot "$LFS" /usr/bin/env -i HOME=/root TERM="$TERM" PS1='(lfs chroot) \u:\w\$ ' \
                                             PATH=/bin:/usr/bin:/sbin:/usr/sbin \
                                             /bin/bash --login +h
chroot: failed to run command '/usr/bin/env': Not a directory

I don't know what the issue is here. Could someone please give me a pointer?

P.S. If there is a better site to put this on, please let me know.

1 Answer 1


Whoops, I found out what was going on.

Early on when I first made the filesystem, I made /lib a symlink to /usr/lib.
Then when I ran these commands:

case $(uname -m) in
  i?86)   ln -sfnv $PWD/elf/ld-linux.so.2        /lib ;;
  x86_64) ln -sfnv $PWD/elf/ld-linux-x86-64.so.2 /lib ;;

It changed the target of the link to $PWD/elf/ld-linux-x86-64.so.2, so the file that wasn't a directory was /lib.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.