I'm setting up a VPS that's running Debian 13, but I'm having trouble using the userdel and deluser commands. When I try to execute them, I get a "command not found" error. However, I can still access their man pages. I'm logged in as root because I'm trying to delete an old user account. I'm not sure where things went wrong in my server setup. Do you think it would be better to just start from scratch since I wouldn't lose much data?
4 Answers
It might be that userdel isn't in your PATH. On Debian, userdel is usually located in /usr/sbin/. You might need to add that to your PATH or use the full path to the command. What did you decide to do eventually?
Are you sure you're logged in as root? That's essential for using userdel. Just checking!
Yeah, I'm trying to do this as root. I ended up reinstalling because I realized I only lost about an hour of work—mostly just waiting around.
Sometimes, on headless setups, you need to install sudo even as root to run certain commands without issues. You might find that helps with rebooting or resizing too.
You can check if the commands are installed properly by running `dpkg -S /usr/sbin/{deluser,userdel}` and also ensure /usr/sbin is on root's PATH. That directory is typically available by default, but it's worth confirming!

I reinstalled, and I was just thinking about how to avoid this in the future. Typing /usr/sbin/[command] every time doesn't sound appealing!