1

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    
11
  • please edit your question with the output of cat /etc/os-release
    – Yaron
    Jan 22, 2019 at 15:32
  • Please help me bro !! Jan 22, 2019 at 15:37
  • Can you open a terminal and enter /usr/bin/sudo and report what it says? Jan 22, 2019 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? Jan 22, 2019 at 15:40
  • 1
    Thanks alot :) pkexec apt-get install sudo worked Jan 23, 2019 at 15:22

1 Answer 1

2

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 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .