0

When trying to switch to root using sudo su :

Error- sudo is not installed 

When trying to switch with su command:

Error- this program is not installed
$ cat /etc/os-release
NAME="Ubuntu"
VERSION="16.04.3 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.3 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

Results of /usr/bin/sudo :

 /usr/bin/sudo bash: /usr/bin/sudo: No such file or directory    
  • please edit your question with the output of cat /etc/os-release – Yaron Jan 22 at 15:32
  • Please help me bro !! – Debashis Priyadarshi Jan 22 at 15:37
  • Can you open a terminal and enter /usr/bin/sudo and report what it says? – Charles Green Jan 22 at 15:38
  • 2
    Either you're on a VPS that doesn't provide root access (except possibly through a management console) or you're removed the sudo package - in which case see Can sudo be reinstalled after being removed? – steeldriver Jan 22 at 15:40
  • 1
    Thanks alot :) pkexec apt-get install sudo worked – Debashis Priyadarshi Jan 23 at 15:22
1

In all currently supported versions of Ubuntu open the terminal and type:

pkexec apt install sudo

You can also test the above command by simulating it without installing anything:

pkexec apt install --simulate sudo 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.