Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install AWS SAM CLI on Linux without Brew

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
like image 930
mon Avatar asked Mar 17 '20 08:03

mon


3 Answers

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

like image 62
Gunjan Solanki Avatar answered Oct 06 '22 10:10

Gunjan Solanki


Use pip

  • awslabs/aws-sam-cli Provide linux installation without homebrew

    I think the docs are bad written. running

    pip install aws-sam-cli

    installs everything OK```

like image 29
mon Avatar answered Oct 06 '22 10:10

mon


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

like image 36
Prashanth Wagle Avatar answered Oct 06 '22 10:10

Prashanth Wagle