A simple way to install the Amazon AWSCLI on RHEL 7 on-demand instances

A simple way to install the Amazon AWSCLI on RHEL 7 on-demand instances

When working with RHEL 7 instances, you might encounter the message “pip is not supported for system python on RHEL” when trying to install the AWS CLI. Here’s a simple solution.

The Problem

RHEL 7 restricts the use of pip with the system Python installation to prevent conflicts with system packages. This can be frustrating when you need to install tools like the AWS CLI.

The Solution

The easiest approach is to use the AWS CLI installer bundle or install it in a virtual environment:

Method 1: Using the AWS CLI Installer Bundle

curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
unzip awscliv2.zip
sudo ./aws/install

Method 2: Using a Virtual Environment

python3 -m venv aws-cli-env
source aws-cli-env/bin/activate
pip install awscli

Method 3: Using the EPEL Repository

sudo yum install epel-release
sudo yum install python-pip
pip install --user awscli

Verification

After installation, verify the AWS CLI is working:

aws --version

This approach ensures you have a working AWS CLI installation without conflicting with the system Python packages on RHEL 7.

links

social