PiHole failing to install on raspbian buster. FTL Error: Unable to get latest release location from GitHub

Nope sorry, still failing at FTL..

EDIT: if it progresses any troubleshooting, aftter modifying the resolv.conf.d/head file and running the install again the resolv.con file still says nameservr 8.8.8.8 so I'm pretty sure it's not losing it's DNS.

I will try to update certificates again.

1 Like

You need to strip off the ^M that curl adds to the end. So the tr -d to remove the special chars is essential.

Not really, tbd is just a variable place holder. It's been removed.

Why are you editing resolv.conf.d/head?

? This is getting very overly complicated, what do the certificates have to do with anything?

One of the accepted solutions to this problem is that github won't release the latest update because of an SSL certificate mismatch and the option to either run the curl with -k or update certificates is offered.

I'm just trying to cover all the bases.

I'm editing that file because DeHakkelaar keeps asking me to do it.

No, that's not the problem. The issue is purely with parsing the curl output.

Don't change 5 things at once or we can't/won't be able to even try to help you.

Like so ?

curl -sSL https://install.pi-hole.net | tr -d '\r' | bash

Or:

curl -sSL https://install.pi-hole.net | sed 's/\r$//g' | bash

EDIT: forgot global

No, use the code exactly as I linked.

latesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep --color=never "Location" | awk -F '/' '{print $NF}' | tr -d '[:cntrl:]')
dschaper@Mariner-10:~/Projects/Pi-hole/core$ latesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep --color=never "Location" | awk -F '/' '{print $NF}')
dschaper@Mariner-10:~/Projects/Pi-hole/core$ echo $latesttag | cat -v
v4.3.1^M
dschaper@Mariner-10:~/Projects/Pi-hole/core$ latesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep --color=never "Location" | awk -F '/' '{print $NF}' | tr -d '[:cntrl:]')
dschaper@Mariner-10:~/Projects/Pi-hole/core$ echo $latesttag | cat -v
v4.3.1
dschaper@Mariner-10:~/Projects/Pi-hole/core$

Edit: That ^M erases the contents of the variable when it's used later.

EDIT: Na response does not match ... hold on :wink:

Pew difficult one:

pi@noads:~ $ curl -sSL https://install.pi-hole.net | sed 's/grep \"Location\".*)/grep --color=never \"Location\" \| awk -F \"\/\" \"{print $NF}\" \| tr -d \"\[:cntrl:\]\" \| tr -d \"\\r\"\)/' | grep '^\s*latesttag='
    latesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep --color=never "Location" | awk -F "/" "{print $NF}" | tr -d "[:cntrl:]" | tr -d "\r")

pi@noads:~ $ curl -sI https://github.com/pi-hole/FTL/releases/latest | grep --color=never "Location" | awk -F "/" "{print $NF}" | tr -d "[:cntrl:]" | tr -d "\r"
Location: https://github.com/pi-hole/FTL/releases/tag/v4.3.1pi@noads:~ $

Seems no CR at end ?

So that would be:

curl -sSL https://install.pi-hole.net | sed 's/grep "Location".*)/grep --color=never "Location" | awk -F "/" "{print $NF}" | tr -d "[:cntrl:]" | tr -d "\r")/' | bash

Hi @drnk,
Seems your issue is not related.
Better create your own thread to post your issue and supply the devs/mods with a debug token to better help you.

Just need the one tr -d for control chars. What does the second one do that isn't accomplished by [:cntrl:]?

latesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep --color=never "Location" | awk -F '/' '{print $NF}' | tr -d '[:cntrl:]')

That's it, no more, no less, no changes, no modifications. Just that.

Edit: To clarify

β€˜[:cntrl:]’
Control characters. In ASCII, these characters have octal codes 000 through 037, and 177 (DEL). In other character sets, these are the equivalent characters, if any.

Yes, that's the point. Nothing at the end. Just v4.3.1.

Having anything other than visible chars in the variable will break it. See the below, the v4.3.1dschaper@Mariner is intended and as it should work.

dschaper@Mariner-10:~/Projects/Pi-hole/core$ latesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep --color=never "Location" | awk -F '/' '{print $NF}' | tr -d '[:cntrl:]')
dschaper@Mariner-10:~/Projects/Pi-hole/core$ printf "This is the latest tag %s" "$latesttag"
This is the latest tag v4.3.1dschaper@Marinerlatesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep --color=never "Location" | awk -F '/' '{print $NF}')
dschaper@Mariner-10:~/Projects/Pi-hole/core$ printf "This is the latest tag %s" "$latesttag"
dschaper@Mariner-10:~/Projects/Pi-hole/core$

Think I got it ?

pi@noads:~ $ curl -sSL https://install.pi-hole.net | sed "s/grep \"Location\".*)/grep --color=never \'Location\' \| awk -F \'\/\' \'{print \$NF}\' \| tr -d \'\[:cntrl:\]\')/" | grep '^\s*latesttag='
    latesttag=$(curl -sI https://github.com/pi-hole/FTL/releases/latest | grep --color=never 'Location' | awk -F '/' '{print $NF}' | tr -d '[:cntrl:]')

pi@noads:~ $ curl -sI https://github.com/pi-hole/FTL/releases/latest | grep --color=never 'Location' | awk -F '/' '{print $NF}' | tr -d '[:cntrl:]'
v4.3.1pi@noads:~ $

So that would be:

curl -sSL https://install.pi-hole.net | sed "s/grep \"Location\".*)/grep --color=never \'Location\' \| awk -F \'\/\' \'{print \$NF}\' \| tr -d \'\[:cntrl:\]\')/" | bash

Without the redundant tr -d :wink:

1 Like

Just checking in, is this what you want me to try?

Wait for @DanSchaper reply .... or just run it for the haeck of it :wink:

Lol I've already been told once. I'll wait.

May work, haven't tested it myself but won't hurt anything to try it.

You crazy SoB you did it!
That command worked! Finally after a week of reinstalling buster and pi-holes it installed properly!

My /etc/resolv.conf is still showing nameserver=8.8.8.8 but I'm going to do a clean flash/reinstall/resetup and run your command there and report back but this is literally the first time in a week it has installed pi-hole.

Thank you!

Please stand by.
:
EDIT: Pi-hole -any command returns "pi-hole: command not found" but I can browse to http://piholeaddress/admin and get the console?

2 Likes