I'm trying to get the alias given in the BLFS book (Basic Packages for
Linux® From Scratch - Version 2018-09-21 : Chapter 1. Introduction :
Getting Started After LFS) working, but it fails with the error:

/usr/sbin/chroot: failed to run command '/usr/bin/env': No such file or
directory

The alias is all on one line in .bashrc:

alias lfs='sudo /usr/sbin/chroot /mnt/lfs /usr/bin/env -i HOME=/root
TERM="$TERM" PS1="\u:\w\\\\$ " PATH=/bin:/usr/bin:/sbin:/usr/sbin
/bin/bash --login'

I've tried several variations of the alias, but I don't see what's
going wrong. I believe I've followed the BLFS book, and what Bruce told
me about this, exactly. Here are some results:

[alan@localhost ~]$ su lfs
Password:
bash-5.0$ bash ~/mount-virt.sh
/mnt/lfs/dev already mounted
/mnt/lfs/dev/pts already mounted
/mnt/lfs/proc already mounted
/mnt/lfs/sys already mounted
/mnt/lfs/run already mounted
mkdir: cannot create directory '/mnt/lfs/run/shm': File exists
bash-5.0$ lfs
[sudo] password for lfs:
/usr/sbin/chroot: failed to run command '/usr/bin/env': No such file or
directory

The above was done after executing the mount-virt.sh script without
errors in prior attempts.

To show that that the environment is set up properly (I'm pretty sure):

[alan@localhost ~]$ su lfs
Password:
bash-5.0$ cd
bash-5.0$ whoami
lfs
bash-5.0$ pwd
/home/lfs
bash-5.0$ cat .bashrc
set +h
umask 022
LFS=/mnt/lfs
LC_ALL=POSIX
LFS_TGT=$(uname -m)-lfs-linux-gnu
PATH=/tools/bin:/bin:/usr/bin
export LFS LC_ALL LFS_TGT PATH
alias ll='ls -l'

alias lfs='sudo /usr/sbin/chroot /mnt/lfs /usr/bin/env -i HOME=/root
TERM="$TERM" PS1="\u:\w\\\\$ " PATH=/bin:/usr/bin:/sbin:/usr/sbin
/bin/bash --login'

Any clues what's going south?

Alan

-- 
http://lists.linuxfromscratch.org/listinfo/blfs-support
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to