The workaround for installing pi-hole seems to be to manually install these packages first sudo apt install php-cgi php-common php php-sqlite3