How to install awscli version 2 on raspberry pi - amazon-web-services

sudo apt install awscli installs currently version 1.16.113-1
The official website (https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2-linux.html) supports aarch64 but not armhf.
Is there another way or something that I am missing. The differences between v1 and v2 are not that big but for example v1 does not support --storage-class DEEP_ARCHIVE

Got this to work on a Raspberry Pi 2 by checking out and installing directly from the awscli v2 branch on github.
You'll need to run a modern python (3.6+?), so the whole procedure is isolated in its own venv so as not to mess up system python.
Based roughly on these directions https://github.com/aws/aws-cli/tree/v2#cli-dev-version we get:
$ git clone https://github.com/aws/aws-cli.git
$ cd aws-cli && git checkout v2
$ pip3 install -r requirements.txt
$ pip3 install .
$ aws --version
aws-cli/2.1.14 Python/3.9.1 Linux/4.19.66+ source/armv6l.raspbian.9 prompt/off

PI 4
Raspberry PI OS Lite 64bit
256 SSD
if you don't switch to v2 you'll be on develop branch which is still v1.n
sudo apt update && sudo apt upgrade -y
sudo reboot
sudo apt install git -y
sudo apt install pip -y
git clone https://github.com/aws/aws-cli.git
cd aws-cli
git switch v2
pip install -r requirements.txt
pip install .
sudo reboot
aws --version
aws configure --profile profileName
...
aws s3 ls

You can install this now from an official download here: https://aws.amazon.com/blogs/developer/aws-cli-v2-now-available-for-linux-arm/

aws cli v2 is still not available in the Python Package Index(PyPI) repository.
I have passed the instruciton below for "How to install aws cli v2"
curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install
how to configure aws cli v2 command line completion permanently
complete -C '/usr/local/bin/aws_completer' aws
echo "complete -C '/usr/local/bin/aws_completer' aws" >> ~/.bashrc
source ~/.bashrc
now you can check by typing any partial command and press the tab key aws s<TAB>

Related

How do I uninstall current minio and install specific version of Minio with kubectl?

I have installed minio using the following command.
kubectl krew install minio
Right now I have v4.5.6
How do I install v4.2.10 of minio kubernetes ?
Krew doesn't allow to install any particular version according to docs yet.
So to uninstall run
kubectl krew uninstall minio
Then manually install the version you like with the below command.
wget https://github.com/minio/operator/releases/download/**v4.2.10**/kubectl-minio_**4.2.10**_linux_amd64 -O kubectl-minio
chmod +x kubectl-minio
mv kubectl-minio /usr/local/bin/

EMR stuck at bootstrap script

Am trying to run a bootstrap file at EMR to installed facebook prophet which seems to have an issue requiring to install dev-tools, the bootstrap.sh simply runs
bootstrap.sh
#!/bin/bash -xe
sudo yum install python3-devel python3-libs python3-tools
#sudo yum groupinstall "Development Tools"
aws s3 cp s3://bucket/requirements.txt .
sudo python3 -m pip install --upgrade pip
sudo python3 -m pip install --upgrade -r ./requirements.txt
,output logs shows the below
and errors logs shows
but then the cluster is stuck for 1 hour before failing
I had to add -y flag to yum inorder to pypass any user prompting

-bash: aws: command not found

I'm on macOS Mojave Version 10.14.5.
I was following the instructions here
Installing the AWS CLI
when I got to the part to type
aws --version
in terminal, and got the response
-bash: aws: command not found
Here's a screenshot of terminal
I looked at the other posts similar to this on stackoverflow, but they seem to apply to different contexts. They have not helped.
you need to install python and pip on your mac in order to install the awscli.
After the installation of python and pip, please use following command to install aws cli with latest version from AWS.
sudo pip install awscli --force-reinstall --upgrade
Install python version 3 or higher And Use this command to download aws cli with python3
curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"
unzip awscli-bundle.zip
sudo /usr/local/bin/python3 awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws
use AWS official guide here to ensure you are installing the latest version.
I have mac and this fixed the issue
$ curl "https://awscli.amazonaws.com/AWSCLIV2.pkg" -o "AWSCLIV2.pkg"
$ sudo installer -pkg AWSCLIV2.pkg -target /
This command works good for me
sudo apt install awscli

Deploying a Geodjango Application on AWS Elastic Beanstalk

I'm trying to deploy a geodjango application on AWS Elastic Beanstalk. The configuration is 64bit Amazon Linux 2017.09 v2.6.6 running Python 3.6. I am getting this error when trying to deploy:
Requires: libpoppler.so.5()(64bit) Error: Package: gdal-java-1.9.2-8.rhel6.x86_64 (pgdg93) Requires: libpoppler.so.5()(64bit)
How do I install the required package? I read through Setting up Django with GeoDjango Support in AWS Beanstalk or EC2 Instance but I am still getting problems. My ebextensions currently looks like:
commands:
01_yum_update:
command: sudo yum -y update
02_epel_repo:
command: sudo yum-config-manager -y --enable epel
03_install_gdal_packages:
command: sudo yum -y install gdal gdal-devel
packages:
yum:
git: []
postgresql95-devel: []
gettext: []
libjpeg-turbo-devel: []
libffi-devel: []
I'm going to answer my own question for the sake my future projects and anyone else trying to get started with geodjango. Updating this answer as of July 2020
Create an ebextensions file to install GDAL on the EC2 instance at deployment:
01_gdal.config
commands:
01_install_gdal:
test: "[ ! -d /usr/local/gdal ]"
command: "/tmp/gdal_install.sh"
files:
"/tmp/gdal_install.sh":
mode: "000755"
owner: root
group: root
content: |
#!/usr/bin/env bash
sudo yum-config-manager --enable epel
sudo yum -y install make automake gcc gcc-c++ libcurl-devel proj-devel geos-devel
# Geos
cd /
sudo mkdir -p /usr/local/geos
cd usr/local/geos/geos-3.7.2
sudo wget geos-3.7.2.tar.bz2 http://download.osgeo.org/geos/geos-3.7.2.tar.bz2
sudo tar -xvf geos-3.7.2.tar.bz2
cd geos-3.7.2
sudo ./configure
sudo make
sudo make install
sudo ldconfig
# Proj4
cd /
sudo mkdir -p /usr/local/proj
cd usr/local/proj
sudo wget -O proj-5.2.0.tar.gz http://download.osgeo.org/proj/proj-5.2.0.tar.gz
sudo wget -O proj-datumgrid-1.8.tar.gz http://download.osgeo.org/proj/proj-datumgrid-1.8.tar.gz
sudo tar xvf proj-5.2.0.tar.gz
sudo tar xvf proj-datumgrid-1.8.tar.gz
cd proj-5.2.0
sudo ./configure
sudo make
sudo make install
sudo ldconfig
# GDAL
cd /
sudo mkdir -p /usr/local/gdal
cd usr/local/gdal
sudo wget -O gdal-2.4.4.tar.gz http://download.osgeo.org/gdal/2.4.4/gdal-2.4.4.tar.gz
sudo tar xvf gdal-2.4.4.tar.gz
cd gdal-2.4.4
sudo ./configure
sudo make
sudo make install
sudo ldconfig
As shown, the script checks whether gdal already exists using the test function. It then downloads the Geos, Proj, and GDAL libraries and installs them in the usr/local directory. At the time of writing this, geodjango (Django 3.0) supports up to Geos 3.7, Proj 5.2 (which also requires projdatum. Current releases do not require it), and GDAL 2.4 Warning: this installation process can take a long time. Also I am not a Linux professional so some of those commands may be redundant, but it works.
Lastly I add the following two environment variables to my Elastic Beanstalk configuration:
LD_LIBRARY_PATH: /usr/local/lib:$LD_LIBRARY_PATH
PROJ_LIB: usr/local/proj
If you still have troubles I recommend checking the logs and ssh-ing in the EC2 instance to check that installation took place. Original credit to this post

How to uninstall aws-cli

I am trying to set up an "Amazon Elastic Container Registry" but I get the following error when using this command: aws ecr get-login --no-include-email --region us-west-2:
Unknown options: --no-include-email
The manual redirects me when this occurs to go to the following page, in order to update my aws cli. https://docs.aws.amazon.com/cli/latest/userguide/installing.html
Which in short means, call pip install awscli --upgrade --user. While that works, my cli is not updated. So I removed it at all pip uninstall awscli. But I still had the aws command available, also when I opened a new session in the terminal...
So I assume I haven't installed my aws cli via pip, but I can not figure out how it does is installed. Can anyone help me out and give me some directions to resolve this issue. So I can remove the current awscli, and install a new version via pip install awscli --upgrade --user
I had a similar issue. Answering in case someone else does too. I think I had originally installed it without pip like this:
https://docs.aws.amazon.com/cli/latest/userguide/awscli-install-bundle.html.
So you just need to uninstall it like this (as instructed in above link):
$ sudo rm -rf /usr/local/aws
$ sudo rm /usr/local/bin/aws
Then you can re-install it with pip3:
https://docs.aws.amazon.com/cli/latest/userguide/cli-install-macos.html
Basically:
pip3 install awscli --upgrade --user
Then add it to your path
export PATH=/Users/yourname/Library/Python/3.6/bin/:$PATH
On ubuntu :
sudo apt-get remove --auto-remove awscli
ln -s /home/ubuntu/.local/bin/aws /usr/bin/aws
Uninstall awscli.
pip uninstall awscli -y
I had the same issue, but unlike Morgan, I prefer to use Homebrew to maintain all my dependencies in a single place.
So what I did was:
1 - uninstall awscli (was installed with pip - python2)
$ sudo rm -rf /usr/local/aws
$ sudo rm /usr/local/bin/aws
2 - Install awscli using homebrew
$ brew install awscli
Homebrew will install awscli inside Cellar folder: /usr/local/Cellar/awscli
Note: I also have python3 installed through Hombrew.
Links:
Amazon-awscli: Amazon Install awscli
Homebrew-awscli: Homebrew Install awscli
Homebrew-python3: Homebrew Install python3
If you are using mac and used brew to install aws cli. Use brew uninstall awscli and try brew install awscli
First try to get the path of the installation by using this command in Linux or mac
which aws-cli
After you get the installation location try removing the directory by using
sudo rm -rf "/path resultant from previous command"
In case if someone has installed aws-cli using Snap,then following method might be helpful :
First, open the Linux terminal and run the following command in it:
sudo snap remove aws-cli
The basic command line to remove a snap package is
sudo snap remove < package >
You have to put the name of a specific application instead of < package >
Once you execute the command successfully, the terminal will ask you to enter the [sudo] password you put for the installation, but if you don’t have any password, press Enter to process it.
After completion of this procedure, you will see that aws-cli gets uninstalled from the system. However, the folder of aws is still present in the snap folder, so execute the following command to remove it:
sudo snap rm -r aws-cli
Remove respective bin & config files:
rm -rf /usr/local/bin/saml2aws
rm -rf ~/.aws/config
rm -rf ~/.aws/credentials
Reinstall using the 'install.sh' script
I tried this on linux and it seemed to work
sudo yum erase awscli
and get me to a place where when I run:
aws --version
zsh: command not found: aws