I uninstall homebrew on a Mac Mini M1 to reinstall it.
After opening a terminal to run the install shell script, the terminal produces the following output and becomes unusable.
[Command not found: /usr/local/bin/zsh]
[Could not create a new process and open a pseudo-tty.]
I have logged into recovery mode and attempted to reset the path with:
mount -uw /
ln -s /usr/local/bin/zsh /usr/bin/
then comming back and trying again without success.
I was directed to this channel in the comments at https://stackoverflow.com/q/70522270/2336356 where it is suggested I open a new terminal and make some changes:
You either changed your login shell to /usr/local/bin/zsh, or configured your default Terminal profile to start /usr/local/bi/zsh instead of your login shell. In either case, you can tell Terminal which process to run in a new terminal window.
However, any terminal I open, whether, iterm of kitty, for example, exit the process immediately after opening. This behavior started at the same time.
This has happened once before on an Intel Mac and I was able to fix it by logging into another admin user which had been set up in case something crazy like this happened. I cant seem to work it out this time.
Any guidance on a solution would be greatly appreciated.
Update
Here is a different error pointing to the same issue in the default terminal:
Last login: Wed Dec 29 19:09:59 on ttys001 login: /usr/local/bin/zsh: No such file or directory
[Process completed]
I then came across this issue https://apple.stackexchange.com/a/126303/174950 and switched to a different user and was able to cat /etc/shells
as the affected user:
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.
/bin/bash
/bin/csh
/bin/dash
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
/usr/local/bin/fish
/usr/local/bin/pwsh
/usr/local/bin/zsh
I removed /usr/local/bin/zsh
and now have:
/bin/bash
/bin/csh
/bin/dash
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
/usr/local/bin/fish
/usr/local/bin/pwsh
Still not working. Maybe I need to remove the ln -s /usr/local/bin/zsh /usr/bin/
symlink executed earlier?