Error at the end of the installation

Hello Pi-hole community !!!

I am facing a problem at the end of the installation of Pi-hole, after entering the parameters in the configuration window.
I saw that someone had the same error as me but it was a long time and it was a problem with the web interface.

My device :

  • raspberry Pi 5 with Raspbian and no graphical interface, only a terminal.
  • For Wifi, I have a USB antenna whose interface name is wlan1, so wlan0 is disconnected.

Expected Behaviour :

After entering the parameters in the configuration window, the directory /etc/.pihole is created and the GitHub repository is cloned in it.

Actual Behaviour :

  • There is a /etc/pihole directory which is created.
  • This is the end of the installation :
    [✗] Check for existing repository in /etc/.pihole
    [i] Using privacy level: 0om/pi-hole/pi-hole.git into /etc/.pihole...
    [✗] Check for existing repository in /etc/.pihole
    [i] Clone https://github.com/pi-hole/pi-hole.git into /etc/.pihole...
    Error: Could not update local repository. Contact support.

What I tried :

  • I tried all the commands explained on the GitHub documentation (same result)
  • I tried to execute these commands with sudo (same result)
  • I tried to manually create the /etc/.pihole directory (he said that there was already the directory and stopped the installation)

I hope I'am not annoying you and I would be very happy to answer your questions.
Sorry for my English, I am French... :sweat_smile:
Have a good day !!! :grinning_face:

Please share the output (or at least the last ~25 lines) from running

curl -sSL https://install.pi-hole.net | bash -x

Thanks a lot Bucking_Horn for answering me !

I'm sorry I'm going to give you an answer 2 days late.

But here is what I think is the end of the installation with the command you gave me :

+ clone_or_reset_repos
+ [[ false == true ]]
+ getGitFiles /etc/.pihole https://github.com/pi-hole/pi-hole.git
+ local directory=/etc/.pihole
+ local remoteRepo=https://github.com/pi-hole/pi-hole.git
+ local 'str=Check for existing repository in /etc/.pihole'
+ printf '  %b %s...' '[i]' 'Check for existing repository in /etc/.pihole'
  [i] Check for existing repository in /etc/.pihole...+ is_repo /etc/.pihole
+ local directory=/etc/.pihole
+ local rc
+ [[ -d /etc/.pihole ]]
+ rc=1
+ return 1
+ printf '%b  %b %s\n' '\r\033[K' '[\e[1;31m✗\e[0m]' 'Check for existing repository in /etc/.pihole'
  [✗] Check for existing repository in /etc/.pihole
+ make_repo /etc/.pihole https://github.com/pi-hole/pi-hole.git
+ local directory=/etc/.pihole
+ local remoteRepo=https://github.com/pi-hole/pi-hole.git
+ str='Clone https://github.com/pi-hole/pi-hole.git into /etc/.pihole'
+ printf '  %b %s...' '[i]' 'Clone https://github.com/pi-hole/pi-hole.git into /etc/.pihole'
  [i] Clone https://github.com/pi-hole/pi-hole.git into /etc/.pihole...+ [[ -d /etc/.pihole ]]
+ git clone -q --depth 20 https://github.com/pi-hole/pi-hole.git /etc/.pihole
+ PRIVACY_LEVEL=0
+ result=0
+ case ${result} in
+ printf '  %b Using privacy level: %s\n' '[i]' 0
  [i] Using privacy level: 0
+ clone_or_reset_repos
+ [[ false == true ]]
+ getGitFiles /etc/.pihole https://github.com/pi-hole/pi-hole.git
+ local directory=/etc/.pihole
+ local remoteRepo=https://github.com/pi-hole/pi-hole.git
+ local 'str=Check for existing repository in /etc/.pihole'
+ printf '  %b %s...' '[i]' 'Check for existing repository in /etc/.pihole'
  [i] Check for existing repository in /etc/.pihole...+ is_repo /etc/.pihole
+ local directory=/etc/.pihole
+ local rc
+ [[ -d /etc/.pihole ]]
+ rc=1
+ return 1
+ printf '%b  %b %s\n' '\r\033[K' '[\e[1;31m✗\e[0m]' 'Check for existing repository in /etc/.pihole'
  [✗] Check for existing repository in /etc/.pihole
+ make_repo /etc/.pihole https://github.com/pi-hole/pi-hole.git
+ local directory=/etc/.pihole
+ local remoteRepo=https://github.com/pi-hole/pi-hole.git
+ str='Clone https://github.com/pi-hole/pi-hole.git into /etc/.pihole'
+ printf '  %b %s...' '[i]' 'Clone https://github.com/pi-hole/pi-hole.git into /etc/.pihole'
  [i] Clone https://github.com/pi-hole/pi-hole.git into /etc/.pihole...+ [[ -d /etc/.pihole ]]
+ git clone -q --depth 20 https://github.com/pi-hole/pi-hole.git /etc/.pihole
+ return 128
+ printf '\n  %bError: Could not update local repository. Contact support.%b\n' '\e[1;31m' '\e[0m'

  Error: Could not update local repository. Contact support.
+ exit 1

What I find odd is that he seems to fail every time but he tries again. Throughout the output, I found that the above information repeated itself.

Thank you for your time with my problem !

This could indicate that the directory already exists, quite probably because your previous installation attempt (or attempts?) already cloned it.

What's the output of:

which pihole
which pihole-FTL
pihole status
sudo systemctl status pihole-FTL

Hello Bucking_Horn !

Thank you very much for your answer, it helped me a lot.

I tried the commands you gave me and it is how I found the problem.

Command : which pihole --> Output : /usr/local/bin/pihole
Command : which pihole-FTL --> Output : /usr/bin/pihole-FTL
Command : pihole status --> Output : -bash: pihole: command not found

After the error during the first installation attempt, I remember deleting the pihole folder in the /etc directory. But I didn't delete the corrupted pihole and pihole-FTL executable files.

So I deleted everything, did an update of my Raspberry Pi and tried again. Then, miraculously, it seemed to work, because as I write this, I'm currently on the Pi-hole web interface.

Solution: For those of you who are experiencing the same problem as I am, avoid re-installing Pi-hole without having completely cleaned up your machine. Remove anything related to pihole or pihole-FTL (files, services, configs), otherwise you risk conflicts with partially installed or corrupted files.

Thanks again for the good atmosphere in this forum and have a nice day.