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

。_饼干妹妹 提交于 2019-12-04 08:55:27

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!

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"
Marcel Bezerra
sudo yum groupinstall "Development Tools"

According to the documentation: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/compile-software.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!