How to Fix Sudo Command Not Found in Debian VPS.

In this article, we will show you how to fix sudo command not found in Debian 10 VPS.

Sudo is a program for Unix-like computer operating systems that enables users to run programs with the security privileges of another user, by default the superuser.It can stand for “superuser do”, as originally that is all it did however, now it might stand for “substitute user, do”, because sudo can run a command as other users as well.

After a fresh Debian 10 installation, you could not execute the privileges tasks by running the sudo command. You will get the error ‘sudo command not found in Debian 10′.

fix sudo command not found in Debian 10 VPS

Log in to your Debian 10 server with root user.

After login, run the following command to verify the sudo error:

sudo apt update

You’ll get the following error:

-bash: sudo: command not found

By default, sudo package is in the Debian 10 default repository. You can install it using the apt command as shown below:

apt install sudo -y

After installing the Sudo package, you will need to create a new regular user and add it to the sudo group.

First, create a new user using the following command:

adduser sajid

Now, add your newly created user to the sudo group:

usermod -aG sudo sajid

This command will grants sudo privileges to the sajid and allow it to use the sudo command to perform administrative privileges.

You can also verify whether the user has been added to the sudo group using the following command:

id sajid

Then, you should see that the user user1 belongs to two groups: sajid and sudo.

uid=1002(sajid) gid=1002(sajid) groups=1002(sajid),27(sudo)

Now, switch the user to user1 and execute any command using the sudo:

su - sajid

sudo apt update

Conclusion

Congratulation!!

So, you are now able to fix the sudo command not found error in Debian 10 virtual private server. Enjoy it.

Sajid Ali
Linux & Windows Server Administrator | Cloud Architect: I possess 10 years of professional experience with administration of different hosting provider’s Linux and Windows based servers on a large production level.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

You might also likeRELATED

How to migrate from CentOS 8 to CentOS Stream Server:

Before 2021, CentOS was regarded as an enterprise-stable, production-ready operating system that had been cloned from Red Hat Enterprise Linux. It had a few...

How to migrate from CentOS 8 to Rocky Linux.

Rocky Linux is a Linux distribution that is intended to be a downstream, complete binary-compatible release using the Red Hat Enterprise Linux operating system...

How to Install Jitsi Meet on Ubuntu 20.04:

In this article you will learn how to install Jitsi Meet on Ubuntu 20.04. Jitsi Meet is a fully encrypted open source JavaScript WebRTC application...