15

I am new to Linux terminal, now I tried to use sudo, apt-get, whereis etc., commands in linux it returns an error bash: sudo: command not found

my command

 $sudo apt-get install libc6-dev

Error is

 bash: sudo: command not found.

Please let me know what could be the issue here, thank you in advance

user1845827
  • 319
  • 2
  • 3
  • 8

2 Answers2

30

Try to login with su

$ su -

and install sudo

# apt-get install sudo
Ajouve
  • 9,735
  • 26
  • 90
  • 137
  • I have the same problem when I try to do 'su' my authentication does not work. Any ideas ? – Anirudh Jan 16 '15 at 16:12
  • yup, I was missing it completely, I had to 'apt-get install sudo' as root and then from my account was able to use sudo – ovi Jan 19 '16 at 21:54
2

Maybe it isn't installed? Open your package manager and install the sudo package.

Also, try to use full path (if you have it installed)

/usr/bin/sudo

if that command work then include /usr/bin/ in your env variable PATH in ~/.bashrc

echo "export PATH="$PATH:/usr/bin"" >> ~/.bashrc

hopefully works ..

George Netu
  • 2,758
  • 4
  • 28
  • 49