I used this guide [Guide] Installing Pi-hole on Unifi Cloudkey v1 and have tried using both bullseye and buster distros both give me the same error. The pihole install is via curl -sSL https://install.pi-hole.net | bash.
I've also finished the OS install with a sudo apt-get full-upgrade and then disabled unneeded services.