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


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


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.



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

  • 2
    It looks like you're using a custom version of bash, not the version installed by default with macOS. You should be able to revert back to the default version by setting the "Shells open with:" setting in Terminal.app's preferences to "/bin/bash". That should at least give you a working shell again so that you can regain CLI access.
    – jefe2000
    Dec 1, 2016 at 19:05
  • How did you install bash?
    – mmmmmm
    Dec 1, 2016 at 23:05
  • @Mark i want to say with brew, if I recall correctly. Not sure how that changed anything today. I got this random error today. The only difference on my system is that yesterday night i installed Unity.
    – JGallardo
    Dec 1, 2016 at 23:12

1 Answer 1


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


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

  • Please don't post text as pictures/screenshots!
    – klanomath
    Dec 2, 2016 at 2:43
  • 2
    In general we prefer text instead of screenshots because they are easier to read and also accessible for people who require screen readers/voice output. It usually is also not necessary to repeat the question in the answer. I've edited your post slightly to remove those parts which do not directly correspond to the problem described in the question.
    – nohillside
    Dec 2, 2016 at 22:19
  • 1
    Besides that, congratulations for a well-documented answer!
    – nohillside
    Dec 2, 2016 at 22:21
  • 1
    Nothing's wrong with me, but if I want to reproduce code/commands in a VM quickly, I would have to type everything (instead of copying and pasting it, which doesn't really work well with code in pics)
    – klanomath
    Dec 2, 2016 at 22:22
  • 1
    I use zsh. I followed the instructions for step 1 as-is, and switched to zsh instead of bash for step 2. This approach worked fine. Aug 8, 2018 at 22:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .