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    
pa4080
  • 29,831

1 Answers1

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 
karel
  • 114,770