How to fix apt-get: command not found on AWS EC2?
UbuntuAmazon Web-ServicesAmazon Ec2Ubuntu Problem Overview
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?
Ubuntu Solutions
Solution 1 - Ubuntu
Try replacing apt-get
with yum
as Amazon Linux based AMI uses the yum
command instead of apt-get
.
Solution 2 - Ubuntu
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.
Solution 3 - Ubuntu
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.
Solution 4 - Ubuntu
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