Installing AWS CLI on CentOS Stream or Red Hat Enterprise Linux (RHEL) puts AWS identity checks, S3 transfers, and repeatable service calls directly into the shell for local administration and automation work.
Current AWS guidance for Linux is the bundled AWS CLI version 2 installer rather than a third-party DNF repository. The archive unpacks a self-contained install program that places the CLI under /usr/local/aws-cli and creates the aws command at /usr/local/bin/aws.
Current CentOS Stream and RHEL minimal images usually already provide a working curl command through curl-minimal, so the main missing prerequisite is usually unzip. Stripped-down hosts can also fail on aws help until groff is installed, and ARM64 systems must use the Linux aarch64 archive instead of the x86_64 file shown below.
Related: How to check AWS CLI version
Related: How to configure AWS CLI on Linux and macOS
Related: How to install AWS CLI on Ubuntu
Related: Install AWS CLI version 1 using pip
$ sudo dnf install --assumeyes unzip groff
Current CentOS Stream and RHEL minimal installs usually already provide a working curl command through curl-minimal. If the next step reports that curl is missing, install the distribution's curl package before continuing.
The AWS CLI installs without groff, but current minimal RHEL-family builds can return Could not find executable named "groff or mandoc" when aws help runs without it.
$ curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
Use https://awscli.amazonaws.com/awscli-exe-linux-aarch64.zip on ARM64 systems.
$ unzip awscliv2.zip
$ sudo ./aws/install You can now run: /usr/local/bin/aws --version
The default install location is /usr/local/aws-cli and the default symlink is /usr/local/bin/aws.
If /usr/local/aws-cli already contains a manual AWS CLI v2 install, rerun the installer with sudo ./aws/install --update to replace it in place.
$ command -v aws /usr/local/bin/aws
If the shell still resolves /usr/bin/aws, remove the older awscli package with sudo dnf remove --assumeyes awscli before retrying.
$ aws --version aws-cli/2.34.32 ##### snipped #####
The remaining runtime and platform fields vary by release and host. The decisive result is that the line starts with aws-cli/2.
Related: How to check AWS CLI version
$ aws sts get-caller-identity
{
"UserId": "AIDASAMPLEUSERID",
"Account": "123456789012",
"Arn": "arn:aws:iam::123456789012:user/PlatformOperator"
}
Configure credentials first with aws configure, aws configure sso, or aws login on a fresh host.
$ rm -r aws awscliv2.zip
Removing these temporary files does not uninstall AWS CLI from /usr/local/aws-cli.