How do I update Pi-hole

Having issues with your DietPi installation, or, found a bug? Post it here.
Post Reply
swrobel
Posts: 10
Joined: Mon Dec 10, 2018 8:04 pm

How do I update Pi-hole

Post by swrobel »

Pi-hole 4.1 came out recently, but my install is still stuck on 4.0. Running pihole -up doesn't seem to work because of modifications that DietPi makes to the Pi-hole files and prevents git from fetching the changes from their repo. Do I need to wait for a new DietPi release that includes 4.1 or is there some recommended method to handle updates to Pihole?

Code: Select all

root@DietPi:~# pihole -up
  [i] Checking for updates...
  [i] Pi-hole Core:	up to date
  [i] Web Interface:	update available
  [i] FTL:		update available

  [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...
  : Could not update local repository. Contact support.
User avatar
Phillski
Posts: 35
Joined: Fri Feb 02, 2018 10:52 am

Re: How do I update Pi-hole

Post by Phillski »

I had this exact same problem, my (hacky) solution was to back up my current pi-hole configuration (whitelist, blacklist etc). Use the dietpi-software utility to uninstall pi-hole and then use the utility to re-install it. After that it was just a couple of minutes to reconfigure it to how I had it before.

A little clunky but at least I ended up with an updated system at the end.
User avatar
johnvick
Legend
Posts: 693
Joined: Wed Jun 08, 2016 11:53 am
Location: New Zealand

Re: How do I update Pi-hole

Post by johnvick »

I'm on 6.19.7 and pihole -up worked fine here.

John
User avatar
WarHawk
Posts: 606
Joined: Thu Jul 20, 2017 8:55 am

Re: How do I update Pi-hole

Post by WarHawk »

Do you use the Web Interface Dashboard?

From the software page
viewtopic.php?f=8&t=5&start=20#p174

Updating PiHole:
PiHole overwrites the lighttpd.conf during updates, so please backup your lighttpd.conf before updating:

Backup lighttpd.conf

Code: Select all

mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.bak
PiHole can then be updated by running pihole -up
Restore lighttpd.conf

Code: Select all

mv /etc/lighttpd/lighttpd.conf.bak /etc/lighttpd/lighttpd.conf
swrobel
Posts: 10
Joined: Mon Dec 10, 2018 8:04 pm

Re: How do I update Pi-hole

Post by swrobel »

WarHawk wrote: Thu Dec 20, 2018 8:55 am Do you use the Web Interface Dashboard?
I do
WarHawk wrote: Thu Dec 20, 2018 8:55 am Updating PiHole:
PiHole overwrites the lighttpd.conf during updates, so please backup your lighttpd.conf before updating:
Unfortunately that didn't work on its own. The issue seems to be that there are modified files in the web folder, however they all just seem to be mode changes.

Code: Select all

root@DietPi:~# mv /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd.conf.bak
root@DietPi:~# cd /var/www/html/admin
root@DietPi:/var/www/html/admin# git diff --summary
 mode change 100644 => 100755 .github/ISSUE_TEMPLATE.md
 ... (~100 files like this)
root@DietPi:/var/www/html/admin# git checkout .
root@DietPi:/var/www/html/admin# pihole -up
root@DietPi:~# mv /etc/lighttpd/lighttpd.conf.bak /etc/lighttpd/lighttpd.conf
That worked.
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: How do I update Pi-hole

Post by MichaIng »

Hi guys, I guess the issue might be related to Pi-hole installs that were 3.X at first.

With Pi-hole 4.X new committed a new option to DietPi to skip webserver install/setup. to allow doing this prior on our own (and in case choose another webserver than lighttpd) and skip overwriting the lighttpd.conf.
If you install a fresh Pi-hole now on DietPi, it will install with this new option and safe it to be applied on pihole -up as well. This should work without issues. But I guess if you started from an earlier version, the required setupVar might be missing, leading to the issue with changed/overwritten lighttpd.conf.
swrobel
Posts: 10
Joined: Mon Dec 10, 2018 8:04 pm

Re: How do I update Pi-hole

Post by swrobel »

Thanks. My installation started with Pi-hole 4.0 and I had to follow the steps above to upgrade to 4.1 (not sure if the lighttpd.conf step was necessary). I was able to upgrade to 4.1.1 without issue and did not move lighttpd.conf this time around.
swrobel
Posts: 10
Joined: Mon Dec 10, 2018 8:04 pm

Re: How do I update Pi-hole

Post by swrobel »

Worth noting: after updating to DietPi 6.20, there were file mode changes in

Code: Select all

/var/www/html/admin
. I had to run

Code: Select all

git checkout .
before

Code: Select all

pihole -up
would complete successfully.
User avatar
MichaIng
Site Admin
Posts: 2293
Joined: Sat Nov 18, 2017 6:21 pm

Re: How do I update Pi-hole

Post by MichaIng »

We identified the issue and will fix it with v6.22. Check out the quick solution: https://github.com/Fourdee/DietPi/issues/2516
Post Reply