Opened 5 years ago

Closed 5 years ago

#60069 closed defect (worksforme)

wireguard-tools needs to use newer bash in El Capitan

Reported by: treble2019 Owned by: cardi (calvin ardi)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port: wireguard-tools

Description

El Capitan has bash version 3.2.57(1)-release from /bin/bash (presume from xcode)

Install wireguard-tools in macports 2.6.2. It installs OK.

when one runs

wg-quick up wg0

(it complains that bash is too old and needs newer bash. Not the exact error message. sorry)

Not sure why it does not automatically use the bash installed in

/opt/local/bin/bash

I had to go to Terminal -> Preferences

Shell opens with

. -> Default login shell

. -> Command (complete path) - change here to /opt/local/bin/bash

now

wg-quick

works fine

Change History (4)

comment:1 Changed 5 years ago by jmroot (Joshua Root)

Keywords: wireguard-tools removed
Milestone: MacPorts 2.7.0
Owner: set to cardi
Status: newassigned

comment:2 Changed 5 years ago by cardi (calvin ardi)

Can you post the contents of your $PATH environment variable?

It should be look something like:

$ echo $PATH
/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

Depending on how you installed MacPorts, your $PATH should be properly set in .bash_profile, .profile, or .bashrc to include /opt/local/bin and /opt/local/sbin at the beginning (see https://guide.macports.org/chunked/installing.shell.html#installing.shell.postflight).

wg-quick executes bash using /usr/bin/env bash. /usr/bin/env looks through the directories in $PATH and uses the first entry matching bash. If your $PATH has /bin before /opt/local/bin, executing bash will use the old, built-in version instead of the newest (the latest version of bash is installed as a dependency of wireguard-tools).

comment:3 Changed 5 years ago by treble2019

Thanks for the quick response. Seems I had to restart the macOS for this to work. Sorry for the noise. Just pasting for future use.

mg32:~ user32$ echo $PATH
/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/X11R6/bin:/opt/X11/bin


mg32:~ user32$ echo $BASH_VERSION
3.2.57(1)-release


mg32:~ user32$ ls /opt/local/bin/bash
/opt/local/bin/bash

mg32:~ user32$ cat .profile 
PATH="/opt/local/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/X11R6/bin:/opt/X11/bin"
export PATH


Please close it. Thanks for your continued support for macports!

comment:4 Changed 5 years ago by mf2k (Frank Schima)

Resolution: worksforme
Status: assignedclosed
Note: See TracTickets for help on using tickets.