- #HOW TO UPDATE BASH ON MAC MAC OS X#
- #HOW TO UPDATE BASH ON MAC INSTALL#
- #HOW TO UPDATE BASH ON MAC UPDATE#
$ sudo ln -s /usr/local/Cellar/bash/4.3.25/bin/bash /bin/bash Then create a symbolic link to the new bash 4.3.25 that brew installed. $ sudo chmod a-x /bin/bash_old /bin/sh_old If you are very paranoid, you can remove execute permissions on the bash_old The old bash and sh still exists at /bin, so after installing you'll rename the old executables to a new file. This installs bash into /usr/local/Cellar/bash/4.3.25/bin/bash
#HOW TO UPDATE BASH ON MAC UPDATE#
Then update brew to the latest list of packages: Or from the developer portal download command_line_tools_for_osx_10.9_september_2014.dmgįollow any instructions if there are problems. If you don't have Xcode installed, you'll need the Xcode command line tools, which can be installed by The most current bash is 4.3.25 Unofficial Update Method: Compile Bash from Source Code using Homebrew GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)Ĭopyright (C) 2007 Free Software Foundation, Inc. To confirm that you are using an outdated bash: Official PatchĪpple has released an Official Bash Security Update Here Checking whether you are vulnerable
![how to update bash on mac how to update bash on mac](https://i.stack.imgur.com/kfOXm.png)
However, if you are offering web services, you might want to update. If you are not, wait until there is an official security update from Apple. GNU bash, version 4.4.12(1)-release (x86_64-apple-darwin16.6.0)Ĭopyright (C) 2016 Free Software Foundation, Inc.First, you don't need to do this unless you are are offering web services to the public internet from your Mac. Note the "License GPLv3+" which is why Apple doesn't bundle it with macOS. If you open Terminal or iTerm2 and run bash -version you should see the new version. Now the new bash is our default login shell.
#HOW TO UPDATE BASH ON MAC MAC OS X#
You can read more about this in Change the Shell in Mac OS X Terminal, but the actual command is very straightforward. So any sessions for that user will use that shell. Next we use chsh to make it your default shell. # Ftpd will not allow users to connect who are not using After adding the new bash path my /etc/shells looks like the following: # List of acceptable shells for chpass(1). As described in /etc/shells, this file has the list of valid login shells. To make bash the default you need to do two more steps.įirst, add the Bash 4 path to your /etc/shells file so that it is an allowed login shell.
![how to update bash on mac how to update bash on mac](https://s3.shunyafoundation.com/s3/c7a8f8fbcbd58da2bec3302dc2fadef9023b8b05/user-account-shell.png)
Making Bash 4 the defaultĪs mentioned above, after installing Bash 4 is still not the default shell. You can also set the bash path for specific profiles in Terminal/iTerm2 using the steps described in answer. This will use the first bash on the PATH. Since it is on your PATH, you can start a Bash 4 session with just bash or it can be used in scripts by using a Shebang.įor example, this will use a specific bash instance. You can find where it is located by running which bash. However, it is not yet your default shell. There are various ways of doing that, I prefer Homebrew.īash 4 is now available on your PATH (assuming Homebrew bin is on your path).
#HOW TO UPDATE BASH ON MAC INSTALL#
Install Bash 4 via Homebrewįirst install the newer version of bash. You can install bash 4+ however and also can make it your default shell (including for Terminal and iTerm2) by doing the following. As said in his answer, Apple does not provide bash 4 due to GPL restrictions.