sudo command not found on Debian Fixed

AIn this blog post I describe why you get sudo command not found on Debian and what you can do to fix it.

sudo: command not found

Sudo is general way of running something under the root user. I use sudo to run a specific command that needs administrative privileges on my computer. This means that instead of opening a root console with su I only run the command I want to as root.

Over the past weeks I have been reviewing other Linux operating systems. To my surprise I ran sudo on Debian 9 and it returned sudo command not found. After some research I found that if you set a root password you need to install sudo manually. To install sudo you can run

su
apt-get install sudo

Once a user has installed sudo you will need to give an account the right to run sudo. If you run the sudo command without rights it will fail with a warning message. So that I can give myself rights to use sudo I can add myself to the group sudo.

To do this you can run the command

usermod -aG sudo chewett

Where chewett is the name of the user you want to give the sudo rights to.

Now I have done this I only need to refresh the group permissions of the user. I can make this happen by logging out and in again.

Hopefully this will help someone like me who is starting to play around with Debian.

One Comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.