SSH - dpkg: command not found?

12,067

The error is that your shell cannot find sudo.

-bash: sudo: command not found

Almost certainly, sudo needs to be installed. Login as root and run:

# apt-get install sudo
Share:
12,067

Related videos on Youtube

Lisandro Vaccaro
Author by

Lisandro Vaccaro

Updated on September 18, 2022

Comments

  • Lisandro Vaccaro
    Lisandro Vaccaro almost 2 years

    I'm running Ubuntu and trying to install Ajax Push Engine:

    This is everything I do since opening the terminal to getting the error:

    lisandrov@lisandrov-Satellite-L655:~/Desktop$ ssh [email protected]
    Password: 
    Last login: Fri Sep  9 22:03:07 2011 from 190.220.54.6
    -bash-3.2$ ls
    ape.deb  backup  data  html  scc  tmp
    -bash-3.2$ sudo dpkg -i ape.deb
    -bash: sudo: command not found
    

    I don't think I'm doing anything wrong, but I just started learning to use the terminal 10 minutes ago so I have no idea why I'm getting this error. Also dpkg works perfectly outside SSH.

    What could be the cause for this error?

    • Tom
      Tom almost 13 years
      Are you running Debian/Ubuntu?
    • Lisandro Vaccaro
      Lisandro Vaccaro almost 13 years
      yes i'm running Ubuntu
    • Noufal Ibrahim
      Noufal Ibrahim almost 13 years
      Check if /usr/bin/dpkg exists and if your PATH variable is set properly. Unless you've seriously mucked around with your system, I don't think you're running a Debian based distro.
    • Lisandro Vaccaro
      Lisandro Vaccaro almost 13 years
      I'm running Ubuntu. At least I know I'm not doing anything wrong, I'll try from Debian tomorrow. /user/bin/dpkg exists and it gives me the info about the command. I don't know how to check my PATH variable. I can use DPKG on my PC just can't run it on my server for some reason. The server is running Linux also
    • Lisandro Vaccaro
      Lisandro Vaccaro almost 13 years
      wait I echoed $path and it gave me: /usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin is that ok or not? How do I fix it?
    • Kusalananda
      Kusalananda almost 13 years
      Log in as root and install sudo first. It seems as if it's missing.
    • Kusalananda
      Kusalananda almost 13 years
      ... or figure out where sudo is installed and add it to your path.
    • Lisandro Vaccaro
      Lisandro Vaccaro almost 13 years
      But sudo does work if I'm not connected to my server. Does that make sense? Once connected to the server, no commands work. (And they used to work)
    • Lisandro Vaccaro
      Lisandro Vaccaro almost 13 years
      Also they used to work. I uploaded and moved ape.deb with the terminal. After moving it suddenly all commands stopped working.
    • Kusalananda
      Kusalananda almost 13 years
      @lisandro, you are aware that the computer that you ssh from and the chusmix server are separate machines, right? And that the setup on one might very well be different from the other. The chusmix server might, for example (if it's not your server), not have sudo installed and might even not be a Ubuntu machine as far as I know. I suggest that you read up on how to use a Unix system from the command line, for example from the Ubuntu documentation UsingTheTerminal and AptGetHowto.