Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I use/install "make" on the Amazon Linux AMI for EC2?

I'm a new user of Amazon EC2.

I want to compile the pptpd package on EC2, but receive the following error:

[root@ip-10-112-xxx-xxx /]# /var/tmp/rpm-tmp.2eILT0: line 58: /usr/bin/make: No such file or directory

I searched the entire root directory tree, but make isn't available:

[root@ip-10-112-59-187 /]# find . -name "make"
./etc/mail/make

I'm wondering whether make is actually installed on the Amazon Linux AMI initially? If not, how do I install it?

like image 716
ciphor Avatar asked Mar 03 '12 06:03

ciphor


People also ask

Which command is used to install software packages in EC2?

Use the yum install package command, replacing package with the name of the software to install.

Can I change the AMI of EC2 instance?

The answer is that you cannot replace the AMI for an existing EC2 instance. However, you can replace the root volume with a new volume which is basically the same thing. That new root volume can come from another EC2 instance.


2 Answers

Preface

The Amazon Linux AMI is (loosely) based on CentOS and a perfectly decent OS for EC2, in fact it has been tailored by Amazon for EC2 specifically:

The Amazon Linux AMI is a supported and maintained Linux image provided by Amazon Web Services for use on Amazon Elastic Compute Cloud (Amazon EC2). It is designed to provide a stable, secure, and high performance execution environment for applications running on Amazon EC2. It also includes packages that enable easy integration with AWS, [...]. Amazon Web Services provides ongoing security and maintenance updates to all instances running the Amazon Linux AMI. [...] [emphasis mine]

However, it is indeed not as widely used yet as some other distributions, with the most popular likely being Ubuntu due to its popularity in general and its dedicated long time tailored support of EC2 in particular (see e.g. the EC2StartersGuide, the Ubuntu Cloud Images or the convenient listing of the Ubuntu AMIs for Amazon EC2 on alestic). This yields two drawbacks:

  • You'll find much more examples/tutorials/etc. for EC2 based on Ubuntu, making things easier eventually.
  • You'll find slightly less precompiled packages available for CentOS, requiring compiling your own eventually (but see below).

Solution

That said, CentOS (and the Amazon Linux AMI in turn) uses the Yum package manager to install and update packages from CentOS (and 3rd party) Repositories (Debian/Ubuntu use the APT package manager instead - the inherent concepts are very similar though), see e.g. section Adding Packages in Amazon Linux AMI Basics:

In addition to the packages included in the Amazon Linux AMI, Amazon provides a yum repository consisting of common Linux applications for use inside of Amazon EC2. The Amazon Linux AMI is configured to point to this repository by default for all yum actions. The packages can be installed by issuing yum commands. For example:

# sudo yum install httpd

Accordingly, you can install make via yum install make (you can get a listing of all readily available packages via yum list all).

Be advised though, that you might actually not need to do that, insofar the Amazon Linux AMI has been built to be binary-compatible with the CentOS series of releases, and therefore packages built to run on CentOS should also run on the Amazon Linux AMI. [emphasis mine]

The desired package pptpd is not part of the standard repositories on CentOS either though, but it is available in the 3rd party Extra Packages for Enterprise Linux (EPEL) repository (see Letter P) - I can't comment on the viability of using this one vs. compiling your own though.

Good luck!

like image 182
Steffen Opel Avatar answered Sep 24 '22 07:09

Steffen Opel


Make is not installed by default on Amazon Linux AMIs. However, you can install it quite easily with yum. If you choose to only install make, you might get some errors later for other packages in the compilation process. If you are going to compile software, you might want to just install all of the development tools at once.

sudo yum groupinstall "Development Tools"
like image 44
Eric N Avatar answered Sep 26 '22 07:09

Eric N