Answers for "chroot: failed to run command ‘/bin/zsh’: No such file or directory"

1

chroot: failed to run command ‘/bin/zsh’: No such file or directory

# This type of error occurs when chroot doesn't find the zsh binary in
# /bin of the 'new root directory'.

root@root~$: ls
debian-stretch 

root@root~$: sudo chroot debian-stretch
chroot: failed to run command ‘/bin/zsh’: No such file or directory

root@root~$: cp /bin/zsh debian-stretch/bin/.

root@root~$: cp /lib/x86_64-linux-gnu/libcap.so.2 
	libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 
	libtinfo.so.5 => /lib/x86_64-linux-gnu/libtinfo.so.5 
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 
	libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6
   	debian-stretch

root@root~$: sudo cp /usr/lib/x86_64-linux-gnu/zsh 
	debian-stretch/usr/lib/x86_64-linux-gnu -r
    
# After all of this command u can therefore run the chroot command 
# normally
Posted by: Guest on September-25-2021

Code answers related to "chroot: failed to run command ‘/bin/zsh’: No such file or directory"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language