Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 937
Pat841 Avatar asked Dec 26 '12 19:12

Pat841


People also ask

How do I fix the apt-get command not found?

After installing the APT package, check the /usr/bin/ directory to ensure if it had properly installed. If the file is empty, then run the locate apt-get command again. If no result is shown, there is no alternative but to reinstall the operating system. This might fix the problem.

Why is my EC2 Linux instance not booting and going into emergency mode?

The most common reasons an instance might boot in emergency mode are: A corrupted kernel. Auto-mount failures because of incorrect entries in the /etc/fstab.

Why is EC2 not connecting?

Check your security group rules. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . In the navigation pane, choose Instances, and then select your instance. On the Security tab at the bottom of the console page, under Inbound rules, check the list of rules that are in effect for the selected instance.


2 Answers

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

like image 103
Engin Yapici Avatar answered Sep 19 '22 03:09

Engin Yapici


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.

like image 34
marius_neo Avatar answered Sep 21 '22 03:09

marius_neo