12

Update on Dec 2020

The AWS github issue is Provide linux installation without homebrew #1424. Please monitor the update in the github issue for the latest status.

AWS finally decided to provide non brew approach.

we have work currently underway to provide a better install experience via pyinstaller. In the near term we will continue publishing to brew to support people that are already using it, as well as pip but the core artifact will be produced using pyinstaller and hopefully allow for a better experience for Linux and macOS users, and it is my hope this will also en courage downstream packages to be published for Linux distributions eg yum and deb repos similar to how AWS cli is commonly available.


Question

Please suggest a way to install AWS SAM in Linux without using homebrew. AWS documentation tells to use homebrew, however there should be a way without using brew.


AWS documentation

Installing the AWS SAM CLI on Linux Step 5: Install the AWS SAM CLI

Follow these steps to install the AWS SAM CLI using Homebrew:

brew tap aws/tap
brew install aws-sam-cli
mon
  • 18,789
  • 22
  • 112
  • 205
  • Are Sam Github releases usefull here? Just trying to figure if those could be used wihtout installing. – titus Dec 17 '20 at 19:46

4 Answers4

15

Use pip

mon
  • 18,789
  • 22
  • 112
  • 205
6

Build latest version from source

git clone https://github.com/awslabs/aws-sam-cli.git && cd aws-sam-cli
python setup.py install
Alexis Facques
  • 1,783
  • 11
  • 19
4

As installing SAM CLI with homebrew is time consuming task, one can simply do following to install it :

  • Install Python > 3 (I did Python 3.7)
  • Then run command python3.7 -m pip install aws-sam-cli

P.s If you face any error due to virtual environment or any python error please run the last command with sudo : sudo python3.7 -m pip install aws-sam-cli

  • I found that after following these steps, I also needed to add ~/Library/Python/3.x/bin to $PATH. – LC1983 Jan 10 '22 at 13:33
3

Adding to the answer of Alexis Facques, do,

Step-1

git clone https://github.com/awslabs/aws-sam-cli.git && cd aws-sam-cli

Step-2 (On Linux)

sudo python3 setup.py install  

OR (On Windows)

sudo python setup.py install

Step-3

cd .. && sudo rm -rf aws-sam-cli

This will install the latest version of the aws-sam-cli directly from the source

Prashanth Wagle
  • 354
  • 5
  • 8