Can't uninstall Pi-hole

Hi, I was trying to switch from development-v6 to development, but ran into some issues (Unable to pull Web development branch) so decided to reinstall Pi-hole.
For some reason I can't uninstall Pi-hole though, I keep getting:

pi@raspberrypi4:~ $ sudo pihole uninstall
  [?] Are you sure you would like to remove Pi-hole? [y/N] y
  [✓] Root user check
/opt/pihole/uninstall.sh: line 42: : No such file or directory

How can I uninstall Pi-hole 'manually'? Thank you!

Why do you use sudo?

Did you try pihole uninstall yet?

Yes I tried, but it prompted me I had to use sudo for some reason.

pi@raspberrypi4:~ $ pihole uninstall
  [✗] The Pi-hole command requires root privileges, try:
      sudo pihole uninstall

I think somewhere in the process of trying v6 I did something wrong, therefore I basically just want to start 'fresh' (I don't care about preserving any data).

Just follow the instruction: "sudo pihole uninstall" will work.

Sadly, it doesn't, as stated in my first post. That's the reason I'm posting here.

I'll repost the result of sudo pihole uninstall:

pi@raspberrypi4:~ $ sudo pihole uninstall
  [?] Are you sure you would like to remove Pi-hole? [y/N] y
  [✓] Root user check
/opt/pihole/uninstall.sh: line 42: : No such file or directory

I think the uninstaller is broken in v6.

https://github.com/pi-hole/pi-hole/issues/5452

Hmm that could be it indeed. Does anyone know of a way to do it 'manually'? I'd really like to reinstall the latest version of v6 to test some API quirks, but I can't seem make it work.

Maybe I overdid it when having similar issues a while back.

  1. I removed manually /etc/pihole folder
  2. Installed latest 5.x PiHole version
  3. Un-installed the 5.x
  4. Installed 6.x beta

No idea if all of that was really necessary but everything works since!

Good luck!

I tried some things and I managed to be able to reinstall v5 by removing a bunch of stuff first:

pi@raspberrypi4:~ $ sudo rm -r -f /etc/pihole
pi@raspberrypi4:~ $ sudo rm -r -f /var/www
pi@raspberrypi4:~ $ sudo rm -r -f /etc/.pihole
pi@raspberrypi4:~ $ sudo rm -r -f /etc/dnsmasq.d/

And then reinstalling with:

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

The next step is upgrading to v6, but that gives a new error:

pi@raspberrypi4:~ $ pihole checkout dev
  Please note that changing branches severely alters your Pi-hole subsystems
  Features that work on the master branch, may not on a development branch
  This feature is NOT supported unless a Pi-hole developer explicitly asks!
  Have you read and understood this? [y/N] y

  [i] Shortcut "dev" detected - checking out development / devel branches...

  [i] Pi-hole Core
  [✓] Switching to branch: 'development' from 'refs/heads/master'
  [i] Already up to date.

  [i] Web interface
fatal: couldn't find remote ref refs/heads/devel
  [✗] Unable to pull Web development branch

as well as

pi@raspberrypi4:~ $ pihole -up
/opt/pihole/update.sh: line 108: : No such file or directory

Try if the following would get you back on the regular Pi-hole repos:

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

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

That seems to work fine!

pi@raspberrypi4:~ $ sudo rm -rf /var/www/html/admin
pi@raspberrypi4:~ $ sudo git clone https://github.com/pi-hole/web.git /var/www/html/admin
Cloning into '/var/www/html/admin'...
remote: Enumerating objects: 37021, done.
remote: Counting objects: 100% (290/290), done.
remote: Compressing objects: 100% (188/188), done.
remote: Total 37021 (delta 150), reused 222 (delta 102), pack-reused 36731 (from 1)
Receiving objects: 100% (37021/37021), 37.44 MiB | 10.48 MiB/s, done.
Resolving deltas: 100% (20195/20195), done.
pi@raspberrypi4:~ $ cd /
pi@raspberrypi4:/ $ sudo rm -rf /etc/.pihole
pi@raspberrypi4:/ $ sudo git clone https://github.com/pi-hole/pi-hole /etc/.pihole
Cloning into '/etc/.pihole'...
remote: Enumerating objects: 23861, done.
remote: Counting objects: 100% (941/941), done.
remote: Compressing objects: 100% (522/522), done.
remote: Total 23861 (delta 554), reused 765 (delta 410), pack-reused 22920 (from 1)
Receiving objects: 100% (23861/23861), 7.91 MiB | 9.69 MiB/s, done.
Resolving deltas: 100% (15206/15206), done.
pi@raspberrypi4:/ $ pihole -v
  Pi-hole version is development v5.18.3-490-g0cf0b2a (Latest: v5.18.3)
  web version is v5.21 (Latest: v5.21)
  FTL version is v5.25.2 (Latest: v5.25.2)
pi@raspberrypi4:/ $ pihole -up
  [✓] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 7.4.33
  [✓] 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!
pi@raspberrypi4:/ $ 

Any guidance on how to switch to v6 beta/development?

I`m having the same problem trying to switch to V6 on the dev branch and the error is the same as jojost1 with the "fatal: couldn't find remote ref refs/heads/devel". anyway to get around this error?

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