Error - non-root privileges - why does this always happen?

Across multiple Pi's, multiple SD cards, multiple installations, I always receive the same error when running:

curl -sSL https://install.pi-hole.net | bash

Without fail, I will always receive an error saying:

[✗] Root user check
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

My normal procedure is install Pi os using the Raspi Imaginer Tool, connect it to a display, run the setup, do an update, enable SSH, move it to my Pi location then continue using Putty logging in using Pi and Raspberry. Then, I simply run that command and get the error. I feel as I if I am doing everything as normal, but other people never get this issue, what's going on?

Whats output for below two ?

whoami

sudo cat /etc/sudoers.d/010_pi-nopasswd

EDIT:

pi@ph5:~ $ curl -sSL https://install.pi-hole.net | bash

  [i] 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
1 Like
  1. Pi

  2. ALL=(ALL) NOPASSWD: ALL

Do you get that last line:

If so, nothing to worry about if the rest of the installation works fine.

EDIT: ow ps, is below with a capital ?

Below is also wrong:

Should be like below default out of the box:

pi@ph5:~ $ sudo cat /etc/sudoers.d/010_pi-nopasswd
pi ALL=(ALL) NOPASSWD: ALL
1 Like

I can't remember - it just seems unusual and I want to know why it does this, it did seem to work in the end and let me install (only to hang and crash on some other symlink part) and yes, that's Pi with a capital, also isn't what you said it should be the same as what I got? (ALL=(ALL) NOPASSWD: ALL)

The pi user should be without capital or the sudoers configuration wont apply:

pi@ph5:~ $ whoami
pi
pi@ph5:~ $ sudo cat /etc/sudoers.d/010_pi-nopasswd
pi ALL=(ALL) NOPASSWD: ALL
1 Like

Apologies I misread - the Pi is non capitalised, it all appears exactly as the above. I just don't get why this error happens? There's no note of it in the docs and I'm doing everything normally? Surely this would confuse newbies when they see this error, what's the proper way of doing it with no error?

For me its no error.
It shows with an [i] for information:

1 Like

I just checked and yes, it is just info - the red threw me off. Still unsure as to what caused this symlink error, which caused a complete system crash.

What symlink error ?

1 Like

The icon was changes recently from cross to [i] to better reflect that it is only an info, not a failure.
https://github.com/pi-hole/pi-hole/pull/3825

You're right about the red color... might be worth to change that as well.

2 Likes

I'd have to re-install and see if I can re-create it, is there a way to completely uninstall the pihole and all of its files?

Checkout the uninstall argument for the pihole command:

1 Like

Thanks, I'll let you know if I can re-create it. Just to confirm, when running the script it's perfectly normal to ignore the information warning me I didn't run it as sudo, or would it be better to type sudo beforehand?

Run the installer as the pi user with:

curl -sSL https://install.pi-hole.net | bash

The pi user already has super powers/privies.

1 Like

Okay, I'll just ignore the "Script called with non-root privileges" info.

Alright, so I ran the uninstaller and it just seemed to stop half way through removing dependancies and kicked my back to pi@pihole:~ $...anyway, I re-installed as you said and it appears it removed the "curl" dependency which is needed to install pihole itself....this must be a joke, why do I constantly keep running into issues with all these docs? I'm following everything to the letter, and getting errors all the time.

EDIT 2: reinstalled curl, now it just throws an error saying " Cancel was selected, exiting installer
" why is pihole-uninstall included in the documentation if it doesn't work, and causes further issues?

it took me forever and asked for each one if I wanted to uninstall:

[i] The following dependencies may have been added by the Pi-hole install:
dhcpcd5 git iproute2 whiptail dnsutils cron curl iputils-ping lsof netcat psmisc sudo unzip wget idn2 sqlite3 libcap2-bin dns-root-data libcap2 lighttpd php7.3-common php7.3-cgi php7.3-sqlite3 php7.3-xml php7.3-json php7.3-intl

Its as simple as flashing the Pi-OS image to the SD card, insert/boot, configure timezone and maybe few others with sudo raspi-config and run the curl command to install.
Thats it.
I've run the installer a couple of times now doing exactly that.
I'd suggest wait for a mod/dev to reply.

1 Like

Thank you for your help - I ended up creating another thread documenting my issues here. I probably will re-flash the SD Card since it's not a major task...but the point is why include a feature that's broken and uninstalls vital dependencies needed for a re-install.

1 Like