3

For some reason I fail to install PiVPN on my raspberry Pi

I run curl -L https://install.pivpn.io | bash

but the output I get is

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   178  100   178    0     0    203      0 --:--:-- --:--:-- --:--:--   204
100 59085  100 59085    0     0  49827      0  0:00:01  0:00:01 --:--:--  230k
:::
::: sudo will be used for the install.
main: Zeile 100: VER_MAP: Falscher Feldbezeichner.

Sorry, I don't know what the english version of the last line is. Does anyone have an idea what the problem is?

Update: Output of cat /etc/os-release

PRETTY_NAME="Debian GNU/Linux bullseye/sid"
NAME="Debian GNU/Linux"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
po.pe
  • 141
  • 6

1 Answers1

3

main: Zeile 100: VER_MAP: Falscher Feldbezeichner. (deutsh) mean main: Line 100: VER_MAP: Incorrect field identifier. (english)

Error is at line 100 of the install.sh

 96. source /etc/os-release
 97. PLAT=$(awk '{print $1}' <<< "$NAME")
 98. VER="$VERSION_ID"
 99. declare -A VER_MAP=(["10"]="buster" ["9"]="stretch" ["8"]="jessie" ["18.04"]="bionic" ["16.04"]="xenial" ["14.04"]="trusty")
100. OSCN=${VER_MAP["${VER}"]}

Try this in your terminal:

source /etc/os-release

then

echo $VERSION_ID and check your output.

Must be :

  • 10 for buster
  • 9 for stretch
  • 8 for jessie
  • 18.04 for bionic
  • 16.04 for xenial
  • 14.04 trusty

You can check for error with this new lines in the script :

source /etc/os-release
PLAT=$(awk '{print $1}' <<< "$NAME")
VER="$VERSION_ID"
declare -A VER_MAP=(["10"]="buster" ["9"]="stretch" ["8"]="jessie" ["18.04"]="bionic" ["16.04"]="xenial" ["14.04"]="trusty")
if [ -z "$VER" ]||[[ ! ${!VER_MAP[@]} =~ $VER ]];then
    echo "This script is not supported on your release version: ${VER} , try for supported OS !"
    OSCN=
    #exit 0
else:
    OSCN=${VER_MAP["${VER}"]}
fi;

The script next code is :

case ${PLAT} in
        Ubuntu|Raspbian|Debian|Devuan)
        case ${OSCN} in
            trusty|xenial|jessie|stretch|buster|bionic)
            ;;
            *)
            maybeOS_Support

That mean if you check for error and set the variable OSCN only if any errors exists. In your case the script will be able to continue and arrive at the following function : maybeOS_Support ... But in your case you specified to use Raspbian Stretch then update your out-of-date Raspbian and try again to install because $VERSION_ID must return 9 for Stretch

Ephemeral
  • 2,167
  • 1
  • 8
  • 19