I'm working on a MacBook Air, that's currently booting to macOS High Sierra 10.13.6. It also has an Ubuntu 16.04 partition, that I am currently trying to reach.
I was trying reinstall rEFInd, which due to SIP is done from the recovery partition. It failed because;
-bash: ./refind-install: /usr/bin/env: bad interpreter: No such file or directory
Which was thrown by the #!/usr/bin/env bash
at the top of the install script.
I had a look and indeed there is no /usr/bin/env
in my recovery partition. There is one on the main partition. This is the terminal in the recovery partition:
[-bash-3.2# ls /usr/bin/env
ls: /usr/bin/env: No such file or directory
[-bash-3.2# ls /Volumes/Macintosh\ HD/usr/bin/env
/Volumes/Macintosh\ HD/usr/bin/env
Now the end goal it to reinstall rEFInd (I had it before, but updating macOS changed the boot order so it no longer boots correctly), but my question right now is: Is it normal to not have /usr/bin/env
in the recovery partition?
The fact that the rEFInd script expects it to be there makes me wonder if I have broken something.
Best Answer
Yes, it's perfectly normal for
/usr/bin/env
to not be in the recovery partition.If you were to mount the Recovery partition and open the
BaseSystem.dmg
container to search for the file, you'll find that it doesn't exist.So,
disk0s3
is the one we want to mountNow, open the recovery system image
BaseSystem.dmg
.A GUI will pop up on the screen with a Finder window.
Traverse to the
/usr/bin
and you'll notice thatenv
is not there.It's important to remember that the Recovery partition is a slimmed down version of the actual base system. To make rEFInd work correctly, it needs to be done on the boot partition, not from the recovery partition. So, in the end, you didn't mess anything up.