Update interrupted and now can't load/update

The issue I am facing:
While running pihole -up something stopped working. Not sure if I had an network hiccup or what, but I lost connection to the pi running the update. I tried reconnecting, and updating again and now I get

/opt/pihole/update.sh: line 108: : No such file or directory
/opt/pihole/update.sh: line 111: package_manager_detect: command not found
/opt/pihole/update.sh: line 112: install_dependent_packages: command not found
/opt/pihole/update.sh: line 115: is_repo: command not found

  Error: Core Pi-hole repo is missing from system!
  Please re-run install script from https://pi-hole.net

I tried running the install script. Selecting Update results in


  [✓] Root user check

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

  [i] SELinux not detected
  [✓] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 7.3.31-1~deb10u5

  [✓] Checking apt-get for upgraded packages... up to date!

  [i] Checking for / installing Required dependencies for OS Check...
  [✓] Checking for grep
  [✓] Checking for dnsutils

  [✓] Supported OS detected
  [i] Checking for / installing Required dependencies for this install script...
  [✓] Checking for git
  [✓] Checking for iproute2
  [✓] Checking for dialog
  [✓] Checking for ca-certificates

  [i] Update option selected
  [✓] Check for existing repository in /etc/.pihole
  [i] Update repo in /etc/.pihole...
  : Could not update local repository. Contact support.

Details about my system:

Selecting "Reconfigure" results in essentially the same thing (errors out and "update local repository").

What I have changed since installing Pi-hole:

This is my primary pihole that I use in a HA setup that was installed years ago following this reddit post

I recently had an issue on the secondary pihole that seems to have resolved, but now this one is acting up. Running pihole -d and it hangs in the "Status" section on M test/tox.ubuntu_23.ini

Let's start with completely removing this directory and rebuilding the repository.

cd /

sudo rm -rf /etc/.pihole

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

I did that and tried a reconfigure. Now I get

  [✓] Root user check

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

  [i] SELinux not detected
  [✓] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 7.3.31-1~deb10u5

  [✓] Checking apt-get for upgraded packages... up to date!

  [i] Checking for / installing Required dependencies for OS Check...
  [✓] Checking for grep
  [✓] Checking for dnsutils

  [✓] Supported OS detected
  [i] Checking for / installing Required dependencies for this install script...
  [✓] Checking for git
  [✓] Checking for iproute2
  [✓] Checking for dialog
  [✓] Checking for ca-certificates

  [i] Reconfigure option selected
  [i] Using interface: eth0
  [i] IPv4 address: 192.168.99.7/24
  [i] Static IP already configured
  [i] Unable to find IPv6 ULA/GUA address
  [i] IPv6 address: 
  [i] Using upstream DNS: Google (ECS, DNSSEC) (8.8.8.8, 8.8.4.4)
  [i] Installing StevenBlack's Unified Hosts List
  [i] Installing Admin Web Interface
  [i] Installing lighttpd
  [i] Query Logging on.
  [i] Using privacy level: 0
  [✓] Check for existing repository in /etc/.pihole
  [i] Update repo in /etc/.pihole...HEAD is now at 60b6a101 v5.17.2 (#5421)
  [✓] Update repo in /etc/.pihole

  [✓] Check for existing repository in /var/www/html/admin
  [i] Update repo in /var/www/html/admin...
  : Could not update local repository. Contact support.

Have you tried pihole -up after removing the .pihole directory?

pi@shutyourpihole:~ $ pihole -up
  [✓] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 7.3.31-1~deb10u5
  [✓] Checking for git
  [✓] Checking for iproute2
  [✓] Checking for dialog
  [✓] Checking for ca-certificates

  [i] Checking for updates...
  [i] Pi-hole Core:	up to date
error: cannot lock ref 'refs/tags/v5.20.2': unable to resolve reference 'refs/tags/v5.20.2': reference broken
  [i] Web Interface:	up to date
  [i] FTL:		up to date

  [✓] Everything is up to date!

Something is also wrong with the web repo, lets nuke that and start again too.

sudo rm -rf /var/www/html/admin
sudo git clone https://github.com/pi-hole/web /var/www/html/admin

Reading through your posts, it seems like maybe you had a power interruption or something on the device at the same time as it was writing to disk - is the power supply rated correctly for the Pi?

I think it's fixed. I came across this post and did what that suggested. The repair seems to have worked this time without erroring out. I'm able to access the web admin and all looks good now.

Thanks. I've been using a poe splitter for a long time now that is rated 5V and I'm using on a 3b+. I don't know what happened but it seems to be working.

I still get the message

error: cannot lock ref 'refs/tags/v5.20.2': unable to resolve reference 'refs/tags/v5.20.2': reference broken

when I run an update, but I'm going to kick that problem down the road for now since it seems to be working.

Do this, it should sort it

Yep, that did it! Thanks!

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.