I received a notification on my pihole web console that it needed an update and the process is usually simple – log into the server and run pihole -up
However, this time I received the error “Could not update local repository. Contact support” – not very helpful.
Reading several articles it seems that any change to the pihole files means the local git repository can get out of sync with the master repository and therefore cannot be updated. I had installed the bandwidth test plugin so I suspect that was the issue. As this plugin didn’t work it was not a huge problem resetting back to a vanilla install.
There were several articles on the pihole site and piecing a few of them together I came up with the following solution.
cd /var/www/html/admin
sudo git fetch –tags
sudo git reset –hard
This gave me the following error:-
fatal: Unable to create ‘/var/www/html/admin/.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.
Removed with the following
cd .git
sudo rm index.lock
Final update command and this time it completed successfully.
pihole -up
This completes the install with
Update Complete!
Current Pi-hole version is v4.2.2
Current AdminLTE version is v4.2
Current FTL version is v4.2.2