[Share] Pi-hole Ultra Script: A System Optimizer & Maintenance Tool for Debian 12 (Bookworm)

Hello Pi-hole Community,

I wanted to share a project I’ve been working on to help Raspberry Pi users running Pi-hole on Debian 12 (Bookworm) get the most out of their hardware.

The Pi-hole Ultra Script is a menu-driven utility designed to "slim down" the OS while ensuring the system remains rock-solid and stable. I built this because many "lite" scripts online are too aggressive and often break D-Bus or remove critical Python dependencies that Pi-hole or raspi-config rely on.

:link: GitHub Repository:

https://github.com/waelisa/Raspberry-Pi-Pi-hole-Debian-Ultra-Script


:rocket: Key Features:

  • Snapshot & Rollback: Before any changes are made, the script creates a snapshot of your dpkg selections and critical /etc configurations. If anything goes wrong, you can revert to the previous state via the menu.

  • Intelligent De-bloating: Removes Desktop components and unnecessary services using exact regex matching to avoid "collateral damage."

  • WiFi Awareness: It checks your active connection before disabling wpa_supplicant to prevent headless users from being locked out.

  • System Health Repairs: Includes dedicated functions to verify and fix D-Bus issues and ensure critical RPi firmware packages are intact.

  • Maintenance: Built-in options to schedule Gravity updates and monitor system health (CPU/RAM/Temp).

:hammer_and_wrench: How to use it:

You can run the script with a single command:

Bash

wget -qO pihole-ultra.sh https://raw.githubusercontent.com/waelisa/Raspberry-Pi-Pi-hole-Debian-Ultra-Script/main/pihole-ultra.sh && chmod +x pihole-ultra.sh && sudo ./pihole-ultra.sh

:shield: Safety First:

I’ve implemented Pre-Flight Checks that verify disk space and memory before starting, as well as a Dry Run mode so you can see exactly what the script will do before it touches your system.

I would love to get your feedback or hear about any additional "protected packages" you think should be added to the safety list!

Best regards,

Wael Isa

1 Like

First of all: Thanks!

Any plans to create a ‘Trixie’ version of this?

Unfortunately I updated my RPi’s to Trixie a while back… :slight_smile:

1 Like

Your deletion of everything in /tmp and /var/tmp seems a little heavy handed and maybe shouldn't be described as "safe".

It could cause any manner of problems for running tasks relying on files in either of those directories. It's safe to delete files created by tasks that have completed though.

Plus:

rm -f /run/dbus/system_bus_socket

Never delete a socket file!

Trixie !
sure will be in next update for all Debian,
now i’m work for Pi-hole + DNSCrypt-Proxy + Unbound: Ultimate Masterpiece Edition full auto install and everything ready with ease, config for privacy, and install everything.
I’ll write post here when script ready soon today maybe

what task you mean?

I’ll update the script to work with all Debian and fix this too, today.

I mean any task that is still executing.

sudo ps x for a list

Any of those may still be relying upon files present in /tmp.