How to fix apt-get: command not found on AWS EC2?

UbuntuAmazon Web-ServicesAmazon Ec2

Ubuntu 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

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPat841View Question on Stackoverflow
Solution 1 - UbuntuEngin YapiciView Answer on Stackoverflow
Solution 2 - Ubuntumarius_neoView Answer on Stackoverflow
Solution 3 - UbuntuhexnetView Answer on Stackoverflow
Solution 4 - UbuntuCristhian RecaldeView Answer on Stackoverflow