Upgrade bash without using the terminal to fix iterm issue dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib

bashhomebrewitermterminal

Question

How can I upgrade bash or otherwise get a CLI to work?

Error

dyld: Library not loaded: /usr/local/opt/readline/lib/libreadline.6.dylib
  Referenced from: /usr/local/bin/bash
  Reason: image not found

Background

Out of nowhere iTerm stopped working.

enter image description here

I uninstalled then reinstalled the latest version. Still getting this error

enter image description here

Then i tried the default Terminal mac app. Now seeing this in there

enter image description here

I have been searching similar problems and they seem to all give instructions on how to update BREW or bash.

https://github.com/Homebrew/homebrew-core/issues/5799

https://gist.github.com/samnang/1759336

But the instructions are with the CLI, which i cannot access


Update 1

I changed the path per a suggestion in the comments. Now Terminal app works but iTerm still has a "broken pipe"

enter image description here

Best Answer

This was what helped me, there may be more "correct" ways but if you just need to get it working, give it a go.

Step 1

Open the default Terminal app, then click on Preferences

enter image description here

You will see a path for "Shells open with"

enter image description here

Change the path to

/bin/bash

Close everything out and restart Terminal. Now it should be working, if not, sorry you might have an additional problem that I did not have. But proceed if you are good at this point.

Step 2

proceed to now update bash

brew install bash

enter image description here

Because I ran install I also had to unlink

brew unlink bash

enter image description here

then I ran the command again to install

brew install bash

enter image description here

At this point i started iTerm up again with no problem

enter image description here