164

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

sudo: apt-get: command not found

Ubuntu comes with apt, so it should be there. How do I fix this?

sebastian-c
  • 15,057
  • 3
  • 47
  • 93
Pat841
  • 2,663
  • 4
  • 17
  • 15

4 Answers4

442

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

kenorb
  • 155,785
  • 88
  • 678
  • 743
Engin Yapici
  • 5,673
  • 5
  • 22
  • 32
22

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,535
  • 1
  • 13
  • 28
5

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
  • 198
  • 2
  • 7
4

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
  • 156,901
  • 35
  • 231
  • 235