Cannot update pihole; Could not update local repository

I want to update using: pihole -up

  • Pi-hole [v5.15.2] · [Update available!]
  • FTL [v5.20.1]
  • Web Interface [v5.18.2] · [Update available!]

Expected Behaviour:

_
Updating pihole (but it does not):
Pi-hole Core: update available
Web Interface: update available
(FTL: up to date)
_

Actual Behaviour:

_
[i] Pi-hole core files out of date, updating local repo.
[✓] Check for existing repository in /etc/.pihole
[i] Update repo in /etc/.pihole...
: Could not update local repository. Contact support.
_

Debug Token:

_
Your debug token is: https://tricorder.pi-hole.net/RnOQYX6b/
_

PS.
Everything else is up to date, I use this line to keep things up2date: sudo bash -c 'for i in update {,dist-}upgrade auto{remove,clean}; do apt-get $i -y ; done'

And also tried to 'unlock': sudo rm -f .git/index.lock

What does the output of the following commands show?

cd /etc/.pihole
sudo git status
1 Like

On branch master
Your branch is behind 'origin/master' by 4 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)

nothing to commit, working tree clean

Okay, try

cd /etc/.pihole
sudo git pull
1 Like
Updating 262ffe45..c7ad7113
error: Unable to create '/etc/.pihole/.git/index.lock': File exists.

Another git process seems to be running in this repository, e.g.
an editor opened by 'git commit'. Please make sure all processes
are terminated then try again. If it still fails, a git process
may have crashed in this repository earlier:
remove the file manually to continue.

I'll try: sudo rm -f .git/index.lock

$ sudo rm -f .git/index.lock
$ sudo git pull
Updating 262ffe45..c7ad7113
Fast-forward
 advanced/pihole-admin.conf | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
$ pihole -up 
  [✓] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 7.3.31-1~deb10u2
  [✓] Checking for git
  [✓] Checking for iproute2
  [✓] Checking for dialog
  [✓] Checking for ca-certificates

  [i] Checking for updates...
  [i] Pi-hole Core:     up to date
  [i] Web Interface:    update available
  [i] FTL:              up to date

  [i] Pi-hole Web Admin files out of date, updating local repo.
  [✓] Check for existing repository in /var/www/html/admin
  [i] Update repo in /var/www/html/admin...HEAD is now at fb1b5c31 Hotfix v5.18.3 (#2512)
  [✓] Update repo in /var/www/html/admin

  [i] If you had made any changes in '/var/www/html/admin/', they have been stashed using 'git stash'
  [i] Local version file information updated.
$ pihole -up
  [✓] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 7.3.31-1~deb10u2
  [✓] Checking for git
  [✓] Checking for iproute2
  [✓] Checking for dialog
  [✓] Checking for ca-certificates

  [i] Checking for updates...
  [i] Pi-hole Core:     up to date
  [i] Web Interface:    up to date
  [i] FTL:              up to date

  [✓] Everything is up to date!

This did the trick, so it seems, awesome :+1:t2:


1 Like

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