Pi-Hole installation error "Unable to locate package php5-xml"

Expected Behaviour:

I am trying to install Pi-Hole on a fresh install of Buster. Hardware = Pi Zero W

pi@raspi:~ $ cat /etc/os-release
PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"
## Actual Behaviour:
pi@raspi:~ $ curl -sSL https://install.pi-hole.net | bash

  [â] Root user check
  [i] Script called with non-root privileges
      The Pi-hole requires elevated privileges to install and run
      Please check the installer for any concerns regarding this requirement
      Make sure to download this script from a trusted source

  [â] Sudo utility check

  [â] Root user check

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

  [â] Update local cache of available packages
  [i] Existing PHP installation detected : PHP version 5.6.40-0+deb8u12
  [â] Disk space check

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

  [i] Installer Dependency checks...
  [â] Checking for dhcpcd5
  [â] Checking for git
  [â] Checking for iproute2
  [â] Checking for whiptail
  [â] Checking for dnsutils

  [â] Supported OS detected
  [i] SELinux not detected
  [i] Using upstream DNS: Google (ECS) (8.8.8.8, 8.8.4.4)
  [i] Static IP already configured
  [i] Unable to find IPv6 ULA/GUA address, IPv6 adblocking will not be enabled
  [i] IPv4 address: 192.168.0.100/24
  [i] IPv6 address: 
  [i] Web Interface On
  [i] Web Server On
  [i] Logging On.
  [â] Check for existing repository in /etc/.pihole
  [i] Update repo in /etc/.pihole...HEAD is now at 56cd7c4 Merge pull request #3549 from pi-hole/release/v5.1.1
  [â] Update repo in /etc/.pihole

  [â] Check for existing repository in /var/www/html/admin
  [i] Update repo in /var/www/html/admin...HEAD is now at d8d3f31 Merge pull request #1480 from pi-hole/release/v5.1
  [â] Update repo in /var/www/html/admin

  [i] Main Dependency checks...
  [â] Checking for cron
  [â] Checking for curl
  [â] Checking for iputils-ping
  [â] Checking for lsof
  [i] Checking for netcat (will be installed)
  [â] Checking for psmisc
  [â] Checking for sudo
  [â] Checking for unzip
  [â] Checking for wget
  [i] Checking for idn2 (will be installed)
  [i] Checking for sqlite3 (will be installed)
  [â] Checking for libcap2-bin
  [i] Checking for dns-root-data (will be installed)
  [â] Checking for libcap2
  [i] Checking for lighttpd (will be installed)
  [â] Checking for php5-common
  [i] Checking for php5-cgi (will be installed)
  [i] Checking for php5-sqlite (will be installed)
  [i] Checking for php5-xml (will be installed)
  [â] Checking for php5-intl
  [i] Processing apt-get install(s) for: netcat idn2 sqlite3 dns-root-data lighttpd php5-cgi php5-sqlite php5-xml, please wait...
--------------------------------------------------------------------------------
E: Unable to locate package php5-xml

Note:

  1. I have followed the steps in the link below but still get the same error.
    PHP error updating to V5.0 - #9

  2. The IP address has been fixed at the router.

  3. The Pi Zero was procured as a starter kit (last week) with NOOBS preinstalled and there are no additional software. ( I did remove Wolfram).

Debug Token:

I have attempted to run pihole -d but get the error
bash: pihole: command not found

Above is confusing.
Did you fresh install/flash Buster on the SD card ?

From the Pi-hole install logs, I can make out the php5-common software package was already installed before the Pi-hole install.
Stock/fresh Buster doesnt have any PHP5 packages in its software repositories:

pi@ph5:~ $ sudo grep -v '^\s*#\|^\s*$' -R /etc/apt/sources.list*
/etc/apt/sources.list:deb http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi
/etc/apt/sources.list.d/raspi.list:deb http://archive.raspberrypi.org/debian/ buster main

pi@ph5:~ $ apt-file search php-cgi
php-cgi: /usr/share/doc/php-cgi/changelog.gz
php-cgi: /usr/share/doc/php-cgi/copyright
php7.1-cgi: /usr/bin/php-cgi7.1
php7.1-cgi: /usr/share/man/man1/php-cgi7.1.1.gz
php7.2-cgi: /usr/bin/php-cgi7.2
php7.2-cgi: /usr/share/man/man1/php-cgi7.2.1.gz
php7.3-cgi: /usr/bin/php-cgi7.3
php7.3-cgi: /usr/share/man/man1/php-cgi7.3.1.gz

So either the default repos has been tempered with.
Or deb package files were installed manually.

Figure out which PHP packages are installed:

dpkg --get-selections '*php*'

Purge/uninstall them all:

sudo apt purge <PACKAGE_1> <PACKAGE_2> <PACKAGE_3> etc

Install one of the Pi-hole dependencies to jumpstart:

sudo apt install php7.3-cgi

Check alternatives:

sudo update-alternatives --config php-cgi

And try Pi-hole install again.

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