I installed new bash via brew

brew install bash
which bash # /opt/homebrew/bin/bash
chsh -s /opt/homebrew/bin/bash

I have added /opt/homebrew/bin/bash to /etc/shells

$ bash --version
GNU bash, version 5.1.8(1)-release (aarch64-apple-darwin20.4.0)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

however, in the terminal, I'm still staying in bash3.2.

echo ${BASH_VERSION} # still being 3.2.57(1)-release

3 Answers 3


The solution is as described by @NobodyNada in the comments. But since he hasn't posted this as an answer for a long time, I paste it here:

Terminal -> Preferences -> General -> Shells open with should be set to "Default login shell".


What you've done -should- work.

Might want to verify the contents of /etc/shells:

# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.


and retry changing the shell:

Scot-MBP:~ sfederman$ chsh -s /opt/homebrew/bin/bash
Changing shell for sfederman.
Password for sfederman:
chsh: no changes made

then testing:

Scot-MBP:~ sfederman$ which bash
Scot-MBP:~ sfederman$ echo ${BASH_VERSION}

This is how I did it on MacBook Pro (Apple M3 Pro) running Sonoma 14.3.1:

  1. Install bash:
    brew install bash
  2. Change the shell to Homebrew's bash:
    sudo chsh -s /opt/homebrew/bin/bash "$USER"
    As Ant pointed out, I had to use sudo to avoid this error:
    chsh: /opt/homebrew/bin/bash: non-standard shell
  3. Create "~/.bash_profile" and add the path to Homebrew:
    eval "$(/opt/homebrew/bin/brew shellenv)"
  4. Quit Terminal.app
  5. Reopen Terminal.app and confirm that bash is the latest version:
    echo ${BASH_VERSION}


  1. In Terminal.app, go to Settings... > [General]: Shells open with: and click Default login shell.

    This was a default setting on my OS.


My /etc/shells doesn't contain the /opt/homebrew/bin/bash path.

However my Terminal.app does use Homebrew's shell:

$ which bash
$ echo ${BASH_VERSION}
  • 1
    Nice summary. Would recommend to add the shell to /etc/shells though, so it can also be selected in the Advanced Users definition in System Settings.
    – nohillside
    Commented Feb 10 at 15:00

You must log in to answer this question.

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