116

I installed Ubuntu 12.04 on my instance and am trying to install packages using apt-get, but I am getting the following error:

sudo: apt-get: command not found

How do I fix this?

kenorb
  • 118,428
  • 63
  • 588
  • 624
Pat841
  • 1,797
  • 4
  • 15
  • 14

4 Answers4

321

Try replacing apt-get with yum as Amazon Linux based AMI uses the yum command instead of apt-get.

kenorb
  • 118,428
  • 63
  • 588
  • 624
Engin Yapici
  • 4,347
  • 5
  • 20
  • 32
16

I guess you are actually using Amazon Linux AMI 2013.03.1 instead of Ubuntu Server 12.x reason why you don't have apt-get tool installed.

marius_neo
  • 1,339
  • 1
  • 11
  • 26
4

Check with "uname -a" and/or "lsb_release -a" to see which version of Linux you are actually running on your AWS instance. The default Amazon AMI image uses YUM for its package manager.

hexnet
  • 187
  • 2
  • 7
3

please, be sure your connected to a ubuntu server, I Had the same problem but I was connected to other distro, check the AMI value in your details instance, it should be something like

AMI: ubuntu/images/ebs/ubuntu-precise-12.04-amd64-server-20130411.1 

hope it helps

Shog9
  • 146,212
  • 34
  • 221
  • 231