[SOLVED] Installing pi-hole 5 not working on proxmox 6.2 when using LXC container due to "useradd: command not found"

Homelabguy27

Member
May 26, 2020
14
4
23
33
Trying to install pihole 5 via official pihole documentation failed with the following message:

Code:
Creating user 'pihole'...basic-install.sh: line 1775: useradd: command not found
[✗] Creating user 'pihole'
basic-install.sh: line 1758: /opt/pihole/gravity.sh: No such file or directory

I think this has something to do with LXC or unprivileged containers (which is checked | On) / debian 10. I wasn't able to try installing pihole on a seperate vm so far.

However, since "useradd" hasn't something to do with pihole in general this shouldn't fail. So some other should be affected by the same issues when using "useradd".

Sure, I could fix the pihole installer script or create the user manually. But I don't want to go an unrecommended way and also wants to know whats going on here.

Ty!
 
  • Like
Reactions: Moayad
I guess this is most likely related to the PATH variable not containing /usr/sbin ...
see e.g. https://www.reddit.com/r/pihole/comments/csgfme/trying_to_install_but_getting_an_error_at_install/

* how do you connect to the container?
* as which user do you try to install pihole?
* how do you become that user?

I hope this helps!

Ha, thanks to bring me to the right way! Its running now.

I switched to root instead of using sudo before.

Since I added my new created user to /etc/sudoers and running the command by them everything successfully completed.

Solved. Ty!
 
  • Like
Reactions: Stoiko Ivanov
Glad that worked out ;) - please mark the thread as 'SOLVED'
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!