Roonbridge Linux install fails with 'Line 12: syntax error: bad substitution

This only happens with the ‘easy install’. However it happens on Ubuntu and I’ve just tried it on an arm device and same thing.

I thought I should post it here so I have a place to say how I fixed it, or if I don’t Roon support might step in and fix it since it’s now happened a couple of times on a couple of different linux distros.

In the VI editor, line 17 is of course blank, that’s useful.

Your title mentions line 12 but you mention 17 in your second post. I’m assuming that 12 is correct…

PACKAGE_NAME_LOWER=${PACKAGE_NAME,}

This is correct syntax to take the value of $PACKAGE_NAME (RoonServer) and convert it to lower case.

Did you download the install script on a different machine and then move it to the linux box or did you grab it directly with the curl command?

Hey, I used wget directly on the machine. Then basically +x etc.

So, I installed curl, just to humour the idea that there’s something specific to curl, the ran through exactly as per web site as below. In this particular case I’m on a Raspbery Pi BTW. You’ll note the very odd error below which interestingly I also remember getting on Ubuntu with it some time ago.

$ curl -O http://download.roonlabs.com/builds/roonbridge-installer-linuxx64.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 16390 100 16390 0 0 19168 0 --:–:-- --:–:-- --:–:-- 25649

$ chmod +x roonbridge-installer-linuxx64.sh
$ sudo ./roonbridge-installer-linuxx64.sh
sudo: unable to execute ./roonbridge-installer-linuxx64.sh: No such file or directory

So that’s a weird error, I try different things:

$ ls -la
total 68
drwxr-s— 5 tc staff 260 Nov 26 17:35 ./
drwxrwxr-x 3 root staff 60 Jan 1 1970 …/
drwxr-s— 2 tc staff 40 Jan 1 1970 .X.d/
-rw-rw-r-- 1 tc staff 11733 Nov 26 17:41 .ash_history
-rw-rw-r-- 1 tc staff 905 Jun 26 19:09 .ashrc
drwxr-s— 3 tc staff 60 Jan 1 1970 .local/
-rw-r–r-- 1 tc staff 920 Dec 31 2014 .profile
-rw-r–r-- 1 tc staff 14 Sep 1 05:07 alsa.tcz.dep
-rw-r–r-- 1 tc staff 446 Sep 1 05:05 alsa.tcz.info
-rw-r–r-- 1 tc staff 15218 Sep 1 05:05 index.html
-rwxr-xr-x 1 tc staff 16390 Nov 26 17:35 roonbridge-installer-linuxx64.sh
-rwxrw-rw- 1 root root 21 Sep 26 00:44 wifi.db
drwxr-xr-x 6 tc staff 140 Jan 1 1970 www/

Yes I am logged in as user ‘tc’

$ chmod 777 roonbridge-installer-linuxx64.sh
$ ./roonbridge-installer-linuxx64.sh
-sh: ./roonbridge-installer-linuxx64.sh: not found
$ sh roonbridge-installer-linuxx64.sh
roonbridge-installer-linuxx64.sh: line 12: syntax error: bad substitution
$ ./roonbridge-installer-linuxx64.sh
-sh: ./roonbridge-installer-linuxx64.sh: not found
$ sudo ./roonbridge-installer-linuxx64.sh
sudo: unable to execute ./roonbridge-installer-linuxx64.sh: No such file or directory
$ su
Password: xxxx
'# ls
alsa.tcz.dep index.html wifi.db
alsa.tcz.info roonbridge-installer-linuxx64.sh www/
'# ./roonbridge-installer-linuxx64.sh
sh: ./roonbridge-installer-linuxx64.sh: not found
'# sh roonbridge-installer-linuxx64.sh
roonbridge-installer-linuxx64.sh: line 12: syntax error: bad substitution

Bah.

I realise I ran the whole thing on the incorrect x86 binary just now. However, the same applies to the ARM binary, though to humour myself I’m doing it all again now, will report if there is any difference.

Yep exactly same.

$ curl -O http://download.roonlabs.com/builds/roonbridge-installer-linuxarmv7hf.sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 16394 100 16394 0 0 24146 0 --:–:-- --:–:-- --:–:-- 26314
$ ls
alsa.tcz.dep roonbridge-installer-linuxarmv7hf.sh www/
alsa.tcz.info roonbridge-installer-linuxx64.sh
index.html wifi.db
$ chmod +x roonbridge-installer-linuxarmv7hf.sh
$ rm roonbridge-installer-linuxx64.sh
rm: remove ‘roonbridge-installer-linuxx64.sh’? y
$ ls
alsa.tcz.dep index.html wifi.db
alsa.tcz.info roonbridge-installer-linuxarmv7hf.sh www/
$ sudo ./roonbridge-installer-linuxarmv7hf.sh
sudo: unable to execute ./roonbridge-installer-linuxarmv7hf.sh: No such file or directory
$ ls -la
total 68
drwxr-s— 5 tc staff 260 Nov 26 17:52 ./
drwxrwxr-x 3 root staff 60 Jan 1 1970 …/
drwxr-s— 2 tc staff 40 Jan 1 1970 .X.d/
-rw-rw-r-- 1 tc staff 12257 Nov 26 17:53 .ash_history
-rw-rw-r-- 1 tc staff 905 Jun 26 19:09 .ashrc
drwxr-s— 3 tc staff 60 Jan 1 1970 .local/
-rw-r–r-- 1 tc staff 920 Dec 31 2014 .profile
-rw-r–r-- 1 tc staff 14 Sep 1 05:07 alsa.tcz.dep
-rw-r–r-- 1 tc staff 446 Sep 1 05:05 alsa.tcz.info
-rw-r–r-- 1 tc staff 15218 Sep 1 05:05 index.html
-rwxr-xr-x 1 tc staff 16394 Nov 26 17:51 roonbridge-installer-linuxarmv7hf.sh
-rwxrw-rw- 1 root root 21 Sep 26 00:44 wifi.db
drwxr-xr-x 6 tc staff 140 Jan 1 1970 www/
$ ./roonbridge-installer-linuxarmv7hf.sh
-sh: ./roonbridge-installer-linuxarmv7hf.sh: not found
$ sh roonbridge-installer-linuxarmv7hf.sh
roonbridge-installer-linuxarmv7hf.sh: line 12: syntax error: bad substitution
$ sudo ./roonbridge-installer-linuxarmv7hf.sh
sudo: unable to execute ./roonbridge-installer-linuxarmv7hf.sh: No such file or directory
$ su
Password:
'# ls -la
total 72
drwxr-s— 5 tc staff 260 Nov 26 17:52 ./
drwxrwxr-x 3 root staff 60 Jan 1 1970 …/
drwxr-s— 2 tc staff 40 Jan 1 1970 .X.d/
-rw-rw-r-- 1 tc staff 12386 Nov 26 17:54 .ash_history
-rw-rw-r-- 1 tc staff 905 Jun 26 19:09 .ashrc
drwxr-s— 3 tc staff 60 Jan 1 1970 .local/
-rw-r–r-- 1 tc staff 920 Dec 31 2014 .profile
-rw-r–r-- 1 tc staff 14 Sep 1 05:07 alsa.tcz.dep
-rw-r–r-- 1 tc staff 446 Sep 1 05:05 alsa.tcz.info
-rw-r–r-- 1 tc staff 15218 Sep 1 05:05 index.html
-rwxr-xr-x 1 tc staff 16394 Nov 26 17:51 roonbridge-installer-linuxarmv7hf.sh
-rwxrw-rw- 1 root root 21 Sep 26 00:44 wifi.db
drwxr-xr-x 6 tc staff 140 Jan 1 1970 www/
'# ./roonbridge-installer-linuxarmv7hf.sh
sh: ./roonbridge-installer-linuxarmv7hf.sh: not found
'# sh roonbridge-installer-linuxarmv7hf.sh
roonbridge-installer-linuxarmv7hf.sh: line 12: syntax error: bad substitution

Also, I’m using Tiny Core Linux in this case, which does appear to be set to use /bin/sh.

On the same machine, download manual version:

~/RoonBridge$ ./check.sh

Checking to see if RoonBridge can run on this machine

Checking for Binary Compatibility                            [   OK   ]
Checking for ALSA Libraries                                  [   OK   ]

STATUS: SUCCESS

~/RoonBridge$ sudo ./start.sh
No fast tls on device. Using fallbacks. Current implementation :
0xee1d0f70 0xe12fff1e 0xe320f000 0xe320f000 0xe59f3018 0xe3a01000 0xe59f2014 0xe08f3003 0xe7932002 0xe3520000 0x15922000 0xeaf0c8dc 0xc33ac 0x4e0 0xe1a02001 0xe1a01000
Initializing
00:00:00.042 Info: ConnectOrStartAndWaitForExit RAATServer
00:00:00.021 Info: Starting /home/tc/RoonBridge/Bridge/RoonBridgeHelper
No fast tls on device. Using fallbacks. Current implementation :
0xee1d0f70 0xe12fff1e 0xe320f000 0xe320f000 0xe59f3018 0xe3a01000 0xe59f2014 0xe08f3003 0xe7932002 0xe3520000 0x15922000 0xeaf0c8dc 0xc33ac 0x4e0 0xe1a02001 0xe1a01000
Not Running (.o)
Running

And now it all works. Not sure what all the HEX code is, nor what Fast TLS is, but it’s working when I go into roon, songs play well, it’s identified as a Roon device and say’s it lossless etc.

Further investigation indicates the error on the manual version is a problem with Mono, which is bundled with Roon. It doesn’t seem to cause any issues, but would be fixed upstream at some point. That doesn’t explain the ‘easy’ install script though, which is clearly not easy at all.

I ran into this a while back and I think that it has to do with different sh packages installed on different distros.

IIRC using the full path to sh worked.

sudo /bin/sh roon_installer.sh

@amp Hi Andrew, I’m getting this same message on the Linux easy install script. I am trying to load Roon onto a Netgear ReadyNAS Pioneer Pro.

I tried your solution

sudo /bin/sh roonserver-installer-linuxx64.sh but it yields the same error. Bash and SH are both on the system. Any Ideas?

If tr command is available you could try to replace that line with:

PACKAGE_NAME_LOWER=`echo "$PACKAGE_NAME" | tr "[:upper:]" "[:lower:]"`

${PACKAGE_NAME,} will only work with bash >= 4.0.

Thanks Christopher. I’m sure the bash on the unit is older than 4.0. So, used your line and it worked to resolve the issue. :smiley:

Just changed it to use tr always. That’s probably a safer bet than bash>4.0.

1 Like