I'm doing an install from an alternative distro: RH9. Gotten to the chroot part, I try: $ env -i chroot /mnt/gentoo /bin/bash env: chroot: No such file or directory but it fails, which probably makes sense, since env -i is supposed to flush the environment including the path variable using the absolute path, I was able to do the chroot succesfully. $ env -i /usr/sbin/chroot /mnt/gentoo /bin/bash just after that, in the chrooted environment I have a similar problem with $ env-update in http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=6 and using the absolute pathname fixes the problem here as well $ /usr/lib/portage/bin/env-update Reproducible: Always Steps to Reproduce: 1. install rh9 2. free partition and create ext3 fs, and mount it under /mnt/gentoo 3. download stage3-athlon-xp-20040218.tar.bz2 on /mnt/gentoo untar it using tar -xvjpf stage?-*.tar.bz2 4. edit /mnt/gentoo/etc/make.conf 5. cp /etc/resolv.conf /mnt/gentoo/etc/resolv.conf 6. env -i chroot /mnt/gentoo /bin/bash Actual Results: $ env -i chroot /mnt/gentoo /bin/bash env: chroot: No such file or directory Expected Results: results seems to be correct (see additional info) looking in the file /usr/src/redhat/SOURCES/coreutils-4.5.3/src/env.c I found the following code snippet: ... env - LOGNAME=foo /hacks/hack bar baz runs the "hack" program on arguments "bar" and "baz" in an environment in which the only variable is "LOGNAME". Note that the "-" option clears out the PATH variable, so one should be careful to specify in which directory to find the program to call. ... so it looks like the env -i behaviour is intentional (note: -i is equivalent to - for the env command)
`env -i` doesnt 'flush' the environment, it totally erases it, including PATH for example, run `env -i env` ... you'll get no output ...
err, to add something useful to my comment, the fix is as you say change from: $ env -i chroot /mnt/gentoo /bin/bash to: $ env -i /usr/sbin/chroot /mnt/gentoo /bin/bash that of course assumes chroot is in /usr/sbin which would be the case for most systems i'd imagine ...
Fixed in CVS. Thanks!