How to manually uninstall Pi-Hole after crashed "pihole -up"

Hello,

first of all I want to thank you for this great software, which is possible to run on a small device like my raspberry pi 2 b alongside with other services.

Unfortunatly I ignored the top rule "Never touch a running system" and tried to major update my pihole v5 setup to v6 and for now nothing is running anymore.

Because I dont't want to make a fresh install with newest raspbian version and broke the other sevices which are running for 5 years now as well, I tried to get the an old version of pi-hole. But, as I understand it correct, this is not intended neither possible.

My next approach was to completly uninstall / clean pihole from my system and install pihole in a docker container which should be more comfortable.

Because I don't found explanations with a internet search I have made this post.

Here is the lsb_release output:

root@raspberrypi:~# lsb_release -a
No LSB modules are available.
Distributor ID:	Raspbian
Description:	Raspbian GNU/Linux 9.4 (stretch)
Release:	9.4
Codename:	stretch

Things I already did:
pihole -uninstall

root@raspberrypi:~# pihole uninstall
  [?] Are you sure you would like to remove Pi-hole? [y/N] y
  [✓] Root user check

  [✓] Root user check

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

  [i] SELinux not detected
  [✓] Update local cache of available packages

  [✓] Checking apt-get for upgraded packages... 189 updates available
  [i] It is recommended to update your OS after installing the Pi-hole!

  [✗] Building dependency package pihole-meta.deb
 Error: Building pihole-meta.deb failed. 

phile -r

root@raspberrypi:~# pihole -r

  [✓] Root user check

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

  [i] SELinux not detected
  [✓] Update local cache of available packages

  [✓] Checking apt-get for upgraded packages... 189 updates available
  [i] It is recommended to update your OS after installing the Pi-hole!

  [✗] Building dependency package pihole-meta.deb
 Error: Building pihole-meta.deb failed. 

pihole -d

root@raspberrypi:~# pihole -d

This process collects information from your Pi-hole, and optionally uploads it to a unique and random directory on tricorder.pi-hole.net.

The intent of this script is to allow users to self-diagnose their installations.  This is accomplished by running tests against our software and providing the user with links to FAQ articles when a problem is detected.  Since we are a small team and Pi-hole has been growing steadily, it is our hope that this will help us spend more time on development.

NOTE: All log files auto-delete after 48 hours and ONLY the Pi-hole developers can access your data via the given token. We have taken these extra steps to secure your data and will work to further reduce any personal information gathered.

*** [ INITIALIZING ]
[i] 2025-04-20:11:59:20 debug log has been initialized.

*** [ INITIALIZING ] Sourcing setup variables
[i] Sourcing /etc/pihole/setupVars.conf...

*** [ DIAGNOSING ]: Core version
[i] Core: v6.0.6 (https://discourse.pi-hole.net/t/how-do-i-update-pi-hole/249)
[i] Remotes: origin	https://github.com/pi-hole/pi-hole.git (fetch)
             origin	https://github.com/pi-hole/pi-hole.git (push)
[i] Branch: master
[i] Commit: v6.0.6-0-g0f7803b

*** [ DIAGNOSING ]: Web version
[i] Web: v6.1 (https://discourse.pi-hole.net/t/how-do-i-update-pi-hole/249)
[i] Remotes: origin	https://github.com/pi-hole/AdminLTE.git (fetch)
             origin	https://github.com/pi-hole/AdminLTE.git (push)
[i] Branch: master
[i] Commit: v6.1-0-g1eaddca8

*** [ DIAGNOSING ]: FTL version
[✓] FTL: v5.2 (https://discourse.pi-hole.net/t/how-do-i-update-pi-hole/249)

*** [ DIAGNOSING ]: lighttpd version
[i] 1.4.45

*** [ DIAGNOSING ]: php version
[i] 7.0.33

*** [ DIAGNOSING ]: Operating system
[✓] Distro:  Raspbian
[✗] Version: 9
[✗] Error: Raspbian is supported but version 9 is currently unsupported (https://docs.pi-hole.net/main/prerequisites/)

*** [ DIAGNOSING ]: SELinux
[i] SELinux not detected

*** [ DIAGNOSING ]: Processor
[✓] armv7l

*** [ DIAGNOSING ]: Networking
[✓] IPv4 address(es) bound to the eth0 interface:
   192.168.0.234/24 matches the IP found in /etc/pihole/setupVars.conf

[✓] IPv6 address(es) bound to the eth0 interface:
   fe80::ba27:ebff:fef8:3a9f does not match the IP found in /etc/pihole/setupVars.conf (https://discourse.pi-hole.net/t/use-ipv6-ula-addresses-for-pi-hole/2127)

   ^ Please note that you may have more than one IP address listed.
   As long as one of them is green, and it matches what is in /etc/pihole/setupVars.conf, there is no need for concern.

   The link to the FAQ is for an issue that sometimes occurs when the IPv6 address changes, which is why we check for it.

[i] Default IPv4 gateway: 192.168.0.1
   * Pinging 192.168.0.1...
[✓] Gateway responded.

*** [ DIAGNOSING ]: Ports in use
*:5232 python3 (IPv4)
127.0.0.1:8010 python3 (IPv4)
*:22 sshd (IPv4)
*:22 sshd (IPv6)

*** [ DIAGNOSING ]: Name resolution (IPv4) using a random blocked domain and a known ad-serving domain
[✗] Failed to resolve zamowienie24.icu via localhost (127.0.0.1)
[✗] Failed to resolve zamowienie24.icu via Pi-hole (192.168.0.234)
[✓] doubleclick.com is 142.251.37.14 via a remote, public DNS server (8.8.8.8)

*** [ DIAGNOSING ]: Pi-hole processes
[✗] lighttpd daemon is inactive
[✗] pihole-FTL daemon is failed

*** [ DIAGNOSING ]: Setup variables
    PIHOLE_INTERFACE=eth0
    IPV4_ADDRESS=192.168.0.234/24
    IPV6_ADDRESS=
    PIHOLE_DNS_1=192.168.0.1
    PIHOLE_DNS_2=192.168.0.1
    QUERY_LOGGING=false
    INSTALL_WEB_SERVER=true
    INSTALL_WEB_INTERFACE=true
    LIGHTTPD_ENABLED=true
    BLOCKING_ENABLED=true

*** [ DIAGNOSING ]: Dashboard and block page
[✗] Block page X-Header: X-Header does not match or could not be retrieved.

[✗] Web interface X-Header: X-Header does not match or could not be retrieved.


*** [ DIAGNOSING ]: Gravity List and Database
-rw-rw-r-- 1 pihole pihole 8761344 Apr 20 04:09 /etc/pihole/gravity.db

*** [ DIAGNOSING ]: Info table
   property              value                                   
   --------------------  ----------------------------------------
   version               12                                      
   updated               1745114952                              
   gravity_count         143684                                  
   Last gravity run finished at: So 20. Apr 04:09:12 CEST 2025

   ----- First 10 Gravity Domains -----
   localhost.localdomain
   ad-assets.futurecdn.net
   ck.getcookiestxt.com
   eu1.clevertap-prod.com
   wizhumpgyros.com
   coccyxwickimp.com
   webmail-who-int.000webhostapp.com
   010sec.com
   01mspmd5yalky8.com
   0byv9mgbn0.com


*** [ DIAGNOSING ]: Groups
   id    enabled  name                                                date_added           date_modified        description                                       
   ----  -------  --------------------------------------------------  -------------------  -------------------  --------------------------------------------------
   0           1  Default                                             2020-09-06 20:17:06  2020-09-06 20:17:06  The default group                                 

*** [ DIAGNOSING ]: Domainlist (0/1 = exact white-/blacklist, 2/3 = regex white-/blacklist)

*** [ DIAGNOSING ]: Clients

*** [ DIAGNOSING ]: Adlists
   id    enabled  group_ids     address                                                                                               date_added           date_modified        comment                                           
   ----  -------  ------------  ----------------------------------------------------------------------------------------------------  -------------------  -------------------  --------------------------------------------------
   1           1  0             https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts                                      2020-09-06 20:17:06  2025-04-18 10:24:01  Migrated from /etc/pihole/adlists.list            
   4        0     0             https://codeberg.org/hagezi/mirror2/raw/branch/main/dns-blocklists/adblock/light.txt                  2025-04-18 10:14:17  2025-04-18 10:24:04  Hagezi Light (https://github.com/hagezi/dns-blockl
   5        0     0             https://codeberg.org/hagezi/mirror2/raw/branch/main/dns-blocklists/adblock/multi.txt                  2025-04-18 10:23:34  2025-04-18 10:24:05  hagezi normal                                     

*** [ DIAGNOSING ]: contents of /etc/pihole

-rw-r--r-- 1 root root 48 Apr 20 04:09 /etc/pihole/local.list
   192.168.0.234 raspberrypi
   192.168.0.234 pi.hole

-rw-r--r-- 1 root root 234 Sep  6  2020 /etc/pihole/logrotate
   /var/log/pihole.log {
   	su root root
   	daily
   	copytruncate
   	rotate 5
   	compress
   	delaycompress
   	notifempty
   	nomail
   }
   /var/log/pihole-FTL.log {
   	su root root
   	weekly
   	copytruncate
   	rotate 3
   	compress
   	delaycompress
   	notifempty
   	nomail
   }

-rw-rw-r-- 1 pihole root 15 Sep  6  2020 /etc/pihole/pihole-FTL.conf
   PRIVACYLEVEL=0

*** [ DIAGNOSING ]: contents of /etc/dnsmasq.d

-rw-r--r-- 1 root root 1394 Sep  6  2020 /etc/dnsmasq.d/01-pihole.conf
   addn-hosts=/etc/pihole/local.list
   addn-hosts=/etc/pihole/custom.list
   localise-queries
   no-resolv
   cache-size=10000
   log-facility=/var/log/pihole.log
   local-ttl=2
   log-async
   server=192.168.0.1
   server=192.168.0.1
   interface=eth0
   server=/use-application-dns.net/

*** [ DIAGNOSING ]: contents of /etc/lighttpd

-rw-r--r-- 1 root root 0 Sep  6  2020 /etc/lighttpd/external.conf

-rw-r--r-- 1 root root 4068 Sep  8  2020 /etc/lighttpd/lighttpd.conf
   server.modules = (
       "mod_access",
       "mod_accesslog",
       "mod_auth",
       "mod_expire",
       "mod_compress",
       "mod_redirect",
       "mod_setenv",
       "mod_rewrite"
   )
   server.document-root        = "/var/www/html"
   server.error-handler-404    = "/pihole/index.php"
   server.upload-dirs          = ( "/var/cache/lighttpd/uploads" )
   server.pid-file             = "/run/lighttpd.pid"
   server.username             = "www-data"
   server.groupname            = "www-data"
   server.port                 = 80
   accesslog.format            = "%{%s}t|%V|%r|%s|%b"
   index-file.names            = ( "index.php", "index.html", "index.lighttpd.html" )
   url.access-deny             = ( "~", ".inc", ".md", ".yml", ".ini" )
   static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
   compress.cache-dir = "/var/cache/lighttpd/compress/"
   compress.filetype  = (
       "application/json",
       "application/vnd.ms-fontobject",
       "application/xml",
       "font/eot",
       "font/opentype",
       "font/otf",
       "font/ttf",
       "image/bmp",
       "image/svg+xml",
       "image/vnd.microsoft.icon",
       "image/x-icon",
       "text/css",
       "text/html",
       "text/javascript",
       "text/plain",
       "text/xml"
   )
   mimetype.assign = (
       ".ico"   => "image/x-icon",
       ".jpeg"  => "image/jpeg",
       ".jpg"   => "image/jpeg",
       ".png"   => "image/png",
       ".svg"   => "image/svg+xml",
       ".css"   => "text/css; charset=utf-8",
       ".html"  => "text/html; charset=utf-8",
       ".js"    => "text/javascript; charset=utf-8",
       ".json"  => "application/json; charset=utf-8",
       ".map"   => "application/json; charset=utf-8",
       ".txt"   => "text/plain; charset=utf-8",
       ".eot"   => "application/vnd.ms-fontobject",
       ".otf"   => "font/otf",
       ".ttc"   => "font/collection",
       ".ttf"   => "font/ttf",
       ".woff"  => "font/woff",
       ".woff2" => "font/woff2"
   )
   include_shell "/usr/share/lighttpd/use-ipv6.pl " + server.port
   include_shell "find /etc/lighttpd/conf-enabled -name '*.conf' -a ! -name 'letsencrypt.conf' -printf 'include \"%p\"
' 2>/dev/null"
   $HTTP["url"] =~ "^/admin/" {
       
       setenv.add-response-header = (
           "X-Pi-hole" => "The Pi-hole Web interface is working!",
           "X-Frame-Options" => "DENY"
       )
       $HTTP["url"] =~ "\.(eot|otf|tt[cf]|woff2?)$" {
           
           setenv.add-response-header = ( "Access-Control-Allow-Origin" => "*" )
       }
   }
   $HTTP["url"] =~ "^/admin/\.(.*)" {
       url.access-deny = ("")
   }
   expire.url = ( "" => "access plus 0 seconds" )
   include_shell "cat external.conf 2>/dev/null"

*** [ DIAGNOSING ]: contents of /etc/cron.d

-rw-r--r-- 1 root root 1754 Sep  6  2020 /etc/cron.d/pihole
   9 4   * * 7   root    PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updateGravity >/var/log/pihole_updateGravity.log || cat /var/log/pihole_updateGravity.log
   00 00   * * *   root    PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole flush once quiet
   @reboot root /usr/sbin/logrotate /etc/pihole/logrotate
   */10 *  * * *   root    PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker local
   15 14  * * *   root    PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker remote
   @reboot root    PATH="$PATH:/usr/sbin:/usr/local/bin/" pihole updatechecker remote reboot

*** [ DIAGNOSING ]: contents of /var/log/lighttpd
/var/log/lighttpd does not exist.
ls: Zugriff auf '/var/log/lighttpd' nicht möglich: Datei oder Verzeichnis nicht gefunden

*** [ DIAGNOSING ]: contents of /var/log

*** [ DIAGNOSING ]: contents of /dev/shm

*** [ DIAGNOSING ]: Locale
    LANG=de_DE.UTF-8

*** [ DIAGNOSING ]: Pi-hole log
ls: Zugriff auf '/var/log/pihole.log' nicht möglich: Datei oder Verzeichnis nicht gefunden

head: '/var/log/pihole.log' kann nicht zum Lesen geöffnet werden: Datei oder Verzeichnis nicht gefunden
   -----head of pihole.log------


********************************************
********************************************
[✓] ** FINISHED DEBUGGING! **

    * The debug log can be uploaded to tricorder.pi-hole.net for sharing with developers only.
    * For more information, see: https://pi-hole.net/2016/11/07/crack-our-medical-tricorder-win-a-raspberry-pi-3/
    * If available, we'll use openssl to upload the log, otherwise it will fall back to netcat.

[?] Would you like to upload the log? [y/N] 
    * Log will NOT be uploaded to tricorder.
    * A local copy of the debug log can be found at: /var/log/pihole_debug.log

Thanks in advance

You are running a very outdated OS.

In this case, we usually suggest to install a new OS and then install Pi-hole.

Thank you for your answer.

I know that this is an old version. But the other stuff on the system works, except pihole.

Update the whole system is not an option for me, that's the reason why I did this post.

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