Amazon Linux: apt-get: command not found

Caio Favero picture Caio Favero · Sep 15, 2015 · Viewed 687.6k times · Source

I'm trying to install an apache server on my AWS instance, however, it seems that it doesn't have the apt package installed.

I googled and all I found was some broken links to this package. I am using Putty on a windows machine if that information helps.

I currently have low to none experience in linux enviroments.

I am running the following version of Linux

Linux ip-172-31-37-96 3.14.48-33.39.amzn1.x86_64 #1 SMP Tue Jul 14 23:43:07 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Can anyone help with that?

Answer

ceejayoz picture ceejayoz · Sep 15, 2015

If you're using Amazon Linux it's CentOS-based, which is RedHat-based. RH-based installs use yum not apt-get. Something like yum search httpd should show you the available Apache packages - you likely want yum install httpd24.

Note: Amazon Linux 2 has diverged from CentOS since the writing of this answer, but still uses yum.