[SOLVED] -bash: pihole: command not found

Please follow the below template, it will help us to help you!

Expected Behaviour:

  • Should be able to see webpage at http://ip_address/admin/
  • Should be able to run pihole -d

Actual Behaviour:

  • Can't access webpage
  • Running pihole returns "bash: pihole: command not found

Debug Token:

  • N/A

I tried to install pihole on my Pi 1 Model B, the installation seemed to be ok but I can't access or run pihole after that. Rebooted and tried installing again and got the same result.

https://imgur.com/a/OEatn

Looks like the installation didn't really finish, for some reason. I am able to see the installation process now. Please close this thread if needs be. Thank you.

Still no luck though. The installation stop at step 15 of 16. It happened twice.
Some details:

  • Raspberry Pi 1 Model B

  • Raspbian Stretch Lite

    ::: Verifying free disk space...
    :::
    ::: Updating local cache of available packages... done!
    :::
    ::: Checking apt-get for upgraded packages.... done!
    :::
    ::: Your system is up to date! Continuing with Pi-hole installation...
    ::: Checking for apt-utils... installed!
    ::: Checking for dialog... installed!
    ::: Checking for debconf... installed!
    ::: Checking for dhcpcd5... installed!
    ::: Checking for git... installed!
    ::: Checking for iproute2... installed!
    ::: Checking for whiptail... installed!
    :::
    ::: Stopping dnsmasq service... done.
    :::
    ::: Stopping lighttpd service... done.
    ::: Using Google DNS servers.
    ::: Static IP already configured
    ::: Found neither IPv6 ULA nor GUA address, blocking IPv6 ads will not be enabled
    ::: IPv4 address: 192.168.0.50/24
    ::: IPv6 address:
    ::: Web Interface On.
    ::: Logging On.
    :::
    ::: Checking for existing repository...
    ::: Updating repo in /etc/.pihole... done!
    done!
    :::
    ::: Checking for existing repository...
    ::: Updating repo in /var/www/html/admin... done!
    done!
    ::: Checking for bc... added to install list!
    ::: Checking for cron... installed!
    ::: Checking for curl... installed!
    ::: Checking for dnsmasq... added to install list!
    ::: Checking for dnsutils... added to install list!
    ::: Checking for iputils-ping... installed!
    ::: Checking for lsof... added to install list!
    ::: Checking for netcat... added to install list!
    ::: Checking for sudo... installed!
    ::: Checking for unzip... installed!
    ::: Checking for wget... installed!
    ::: Checking for lighttpd... added to install list!
    ::: Checking for php-common... added to install list!
    ::: Checking for php-cgi... added to install list!
    aapi@raspberrypi:~ $ pihole
    -bash: pihole: command not found

What is the output of:

sudo apt-get update

pi@raspberrypi:~ $ sudo apt-get update
Get:1 http://mirrordirector.raspbian.org/raspbian stretch InRelease [15.0 kB]
Get:2 http://mirrordirector.raspbian.org/raspbian stretch/main armhf Packages [11.7 MB]
Hit:3 http://archive.raspberrypi.org/debian stretch InRelease
Fetched 11.7 MB in 47s (245 kB/s)
Reading package lists... Done

What is the output of this?

sudo apt-get install -y bc

pi@raspberrypi:~ $ sudo apt-get install -y bc
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
bc
0 upgraded, 1 newly installed, 0 to remove and 17 not upgraded.
Need to get 96.3 kB of archives.
After this operation, 195 kB of additional disk space will be used.
Get:1 http://mirrordirector.raspbian.org/raspbian stretch/main armhf bc armhf 1.06.95-9 [96.3 kB]
Fetched 96.3 kB in 2s (44.3 kB/s)
Selecting previously unselected package bc.
(Reading database ... 35452 files and directories currently installed.)
Preparing to unpack .../bc_1.06.95-9_armhf.deb ...
Unpacking bc (1.06.95-9) ...
Processing triggers for install-info (6.3.0.dfsg.1-1+b1) ...
Processing triggers for man-db (2.7.6.1-2) ...
Setting up bc (1.06.95-9) ...
pi@raspberrypi:~ $

It works now, thank you very much, Mcat12! :slight_smile:

Hi all,

This topic should be tagged as osmc or similar so OSMC https://osmc.tv users can benefit from pihole too.
First of all: I had to execute this to finish the installation.
[SOLVED] -bash: pihole: command not found - #5 by piehole

Also it is necessary to change pihole default web admin interface port inside /etc/lighttpd/lighttpd.conf
to something like 8088, so it does not interfere with Kodi's web UI.

I have also disabled pihole's dhcpcd as it interferes with connman too:
sudo systemctl disable dhcpcd

To pihole devs: guys, can you pls. consider update of your great tool so it does not require that necessary portion of magic as above? :wink:
Thx in advance!
Cheers!