Error: "Could not update local repository. Contact support."

I am getting this error when installing Pi Hole on a fresh copy of Rasbian on a Raspberry Pi 2.

Could not update local repository. Contact support.

Below is what is displayed during the installation:

pi@raspberrypi:~ $ curl -sSL https://install.pi-hole.net | bash

    .;;,.
    .ccccc:,.
     :cccclll:.      ..,,
      :ccccclll.   ;ooodc
       'ccll:;ll .oooodc
         .;cll.;;looo:.
             .. ','.
            .',,,,,,'.
          .',,,,,,,,,,.
        .',,,,,,,,,,,,....
      ....''',,,,,,,'.......
    .........  ....  .........
    ..........      ..........
    ..........      ..........
    .........  ....  .........
      ........,,,,,,,'......
        ....',,,,,,,,,,,,.
           .',,,,,,,,,'.
            .',,,,,,'.
              ..'''.

[βœ—] Root user check
Script called with non-root privileges
The Pi-hole requires elevated privleges to install and run
Please check the installer for any concerns regarding this requirement
Make sure to download this script from a trusted source

[βœ“] Sudo utility check

    .;;,.
    .ccccc:,.
     :cccclll:.      ..,,
      :ccccclll.   ;ooodc
       'ccll:;ll .oooodc
         .;cll.;;looo:.
             .. ','.
            .',,,,,,'.
          .',,,,,,,,,,.
        .',,,,,,,,,,,,....
      ....''',,,,,,,'.......
    .........  ....  .........
    ..........      ..........
    ..........      ..........
    .........  ....  .........
      ........,,,,,,,'......
        ....',,,,,,,,,,,,.
           .',,,,,,,,,'.
            .',,,,,,'.
              ..'''.

[βœ“] Root user check
[βœ“] Disk space check

[βœ“] Update local cache of available packages

[βœ“] Checking apt-get for upgraded packages... 42 updates available
[i] It is recommended to update your OS after installing the Pi-hole!

[i] Installer Dependency checks...
[βœ“] Checking for apt-utils
[i] Checking for dialog (will be installed)
[βœ“] Checking for debconf
[βœ“] Checking for dhcpcd5
[βœ“] Checking for git
[βœ“] Checking for iproute2
[βœ“] Checking for whiptail

[βœ“] Stopping dnsmasq service...

[βœ“] Stopping lighttpd service...
[i] Using interface: eth0
[i] Using Google DNS servers
[i] Your static IPv4 address: 192.168.1.100/24
[i] Your static IPv4 gateway: 192.168.1.1
[βœ“] Set IP address to 192.168.1.100
You may need to restart after the install is complete
[i] Unable to find IPv6 ULA/GUA address, IPv6 adblocking will not be enabled
[i] IPv4 address: 192.168.1.100/24
[i] IPv6 address:
[i] Web Interface On
[i] Logging On.
[βœ—] 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.
pi@raspberrypi:~ $

Any help with this would be greatly appreciated!

EDIT: Tried the install again and it worked the second time. I am all good now. This is resolved.

1 Like
1 Like

I am getting this error but didn't make any changes...

Wouldn't know how to make a change...

What is the output of this command?

sudo git clone -q --depth 1 https://github.com/pi-hole/pi-hole.git /etc/.pihole

I also could not update my pihole today and so I followed this post and am providing the command output from the git clone command. Let me know if there are other troubleshooting steps I can help with

pi@raspberrypi:~ $ sudo git clone -q --depth 1 https://github.com/pi-hole/pi-hole.git /etc/.pihole
fatal: destination path '/etc/.pihole' already exists and is not an empty directory.

You do not have the same issue, because the original issue is on a fresh install and you are updating. Please make a new topic.

This solved the problem for me. However I had to do sudo git remote prune origin due to conflicting branches.

I had the same error. Then I realized during the install/setup I left it set to ethernet, but I was only using wifi on the pi. Reran the install/setup, selected wifi, and got past this error.

1 Like

I had the same error when trying to install for the first time on an Octopi distro. On this distro by default it blocks running git as root. Trying to do so will display the command needed to enable this, fixing the issue for me.

I was using octopi and had the same issue.
I ran

which suggested i rm /etc/bin/git to run as root

1 Like

I encountered this because my git was configured to use SSH instead of HTTPS for GitHub (common if you use Go modules).

To verify this is your problem, you will see this:

$ sudo git clone -q --depth 1 https://github.com/pi-hole/pi-hole.git /etc/.pihole
git@github.com: Permission denied (publickey).

Fix is to run git config --global --edit and (temporarily) remove the offending lines.

1 Like

sudo rm /etc/.pihole/.git/index.lock

fixes the issue