Pavel
Pavel

Reputation: 271

I can not use sudo and other commands in ubuntu on amazon server

I create server on amazon and want connect to it by SSH in putty. I connect successfully but i can not send comands. I have errors:

sudo apt-get install openjdk-7-jdk
sudo: apt-get: command not found



apt-get install openjdk-7-jdk
-bash: apt-get: command not found

root apt-get install openjdk-7-jdk
-bash: root: command not found

but if i write sudo

 sudo
usage: sudo [-D level] -h | -K | -k | -V
usage: sudo -v [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-u user
            name|#uid]
usage: sudo -l[l] [-AknS] [-D level] [-g groupname|#gid] [-p prompt] [-U user
            name] [-u user name|#uid] [-g groupname|#gid] [command]
usage: sudo [-AbEHknPS] [-r role] [-t type] [-C fd] [-D level] [-g
            groupname|#gid] [-p prompt] [-u user name|#uid] [-g groupname|#gid]
            [VAR=value] [-i|-s] [<command>]
usage: sudo -e [-AknS] [-r role] [-t type] [-C fd] [-D level] [-g
            groupname|#gid] [-p prompt] [-u user name|#uid] file ...

what is it?

Upvotes: 1

Views: 110

Answers (1)

Smajl
Smajl

Reputation: 7995

It is not sudo which is causing you trouble but missing apt-get.

Check which version of linux you are running on your instance. The default Amazon Linux AMI uses YUM as its package manager so it has not apt-get installed.

Try installing with yum instead of apt-get:

sudo yum <package-name>

To install openJDK, this should work on Amazon Linux AMI:

sudo yum install java-1.7.0-openjdk

Upvotes: 1

Related Questions