6

I'm trying to update a software sdman in my macOs But I get bash outadted version error.

rajkumar.natarajan$ sdk update   
    An outdated version of bash was detected on your system!
    We recommend upgrading to bash 4.x, you have:

    3.2.57(1)-release
    Need to use brute force to replace candidates...

But bash version is already latest.

rajkumar.natarajan$ which bash 
/usr/local/bin/bash   
rajkumar.natarajan$ bash --version   
GNU bash, version 5.0.11(1)-release (x86_64-apple-darwin16.7.0)
Copyright (C) 2019 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.
1

2 Answers 2

10

sdman is looking at /bin/bash which is version 3.2.57 because macos cannot ship with anything newer than it.

The reason that Apple includes such an old version of Bash in its operating system has to do with licensing. Since version 4.0 (successor of 3.2), Bash uses the GNU General Public License v3 (GPLv3), which Apple does not (want to) support. You can find some discussions about this here and here. Version 3.2 of GNU Bash is the last version with GPLv2, which Apple accepts, and so it sticks with it.

source

You have installed a modern version of bash but you haven't replaced /bin/bash with it. I don't really recommend doing that as it could potentially break some legacy scripts/programs (unlikely but possible).

My recommendation is to ignore that warning. It's warning you because bash v3.2 normally would suffer from the shellshock vulnerability, however Apple has patched this in their version of Bash v3.2.

If you are unable to ignore that warning and really want to risk updating your /bin/bash I would move it to a backup location and symlink your new bash to it.

sudo mv /bin/bash /bin/bash.bak
sudo ln -s /usr/local/bin/bash /bin/bash

But in order to do this you will need to bypass SIP

To enable or disable System Integrity Protection, you must boot to Recovery OS and run the csrutil(1) command from the Terminal.

  • Boot to Recovery OS by restarting your machine and holding down the Command and R keys at startup.
  • Launch Terminal from the Utilities menu.
  • Enter the following command:
    $ csrutil disable
  • After enabling or disabling System Integrity Protection on a machine, a reboot is required.
3
  • 3
    Also, if you replace /bin/bash, it might get re-replaced (back to version 3.2.57) by an Apple system update, security update, etc. Commented Nov 2, 2019 at 22:26
  • Rather than symlinking /bin/bash/ to /usr/local/bin/bash you could instead configure the terminal preferences to use that location. For example: Terminal -> Preferences -> General -> Shells open with: -> Command: /usr/local/bin/bash.
    – axiopisty
    Commented Jan 31, 2020 at 0:00
  • @axiopisty: that isn't exactly the issue here, you can also just set your login shell to your preferred bash version which op has already done judging by the output in their question. However regardless of the login shell or current shell in use, the program is complaining about the sheer fact that /bin/bash exists and is "outdated"
    – jesse_b
    Commented Jan 31, 2020 at 0:01
1

You can force update to latest version this way :

$ sdk selfupdate force

You must log in to answer this question.

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