As an AWS Solutions Architect, I’ve helped many clients remove the AWS CLI from their systems. In this article, I’ll walk you through the various methods to uninstall AWS CLI across different operating systems and installation types. By the end of this tutorial, you’ll have a clear understanding of how to remove AWS CLI from your system entirely.
Table of Contents
How to uninstall AWS CLI
Case 1: On Windows
Method 1: Using Control Panel
To uninstall AWS CLI, follow the steps below.
- Open the Control Panel –> Click on Programs –> Click on Programs and Features.
- Select the AWS Command Line Interface and click the Uninstall button, as highlighted below.

You can also right-click the AWS Command Line Interface and then select the Uninstall option.
3. Click the Yes button to confirm the uninstallation process on the next pop-up.
Method 2: Using pip
If you installed AWS CLI using pip (Python package manager), use:
pip uninstall awscli -yOr if you used pip3:
pip3 uninstall awscli -yCase 2: On Linux
The uninstallation method depends on the approach used during your initial installation. You can easily uninstall the AWS CLI on Linux by removing the two items below using the two commands below
$ sudo rm -rf /usr/local/aws
$ sudo rm /usr/local/bin/awsMethod 1: For Snap Installations
If you installed AWS CLI using snap:
sudo snap remove aws-cli
You might also need to remove the AWS folder in the snap directory:
sudo rm -rf /snap/aws-cliMethod 2: For Pip Installations on Linux
For Python-based installations:
sudo pip uninstall awscli -y
# OR
sudo pip3 uninstall awscli -yMethod 3: For Yum-Based Distributions (Amazon Linux, CentOS, RHEL)
If you installed using yum:
sudo yum remove awscliCase 3: On Ubuntu
If you have decided to uninstall the AWS CLI on Ubuntu, you can do that using the following commands.
Execute the command below to uninstall the AWS CLI on Ubuntu.
sudo apt-get remove awscliIf you want to uninstall the AWS CLI package and its dependencies, you can use the following command.
sudo apt-get remove --auto-remove awscliTo remove the AWS CLI and all its configurations, you can use the following command.
sudo apt-get purge awscliOr, for the same purpose, you can also use the command below.
sudo apt-get purge --auto-remove awscliCase 4: On Mac
macOS users typically install AWS CLI via Homebrew, the bundled installer, or pip. Let’s cover each method.
Method 1: Uninstalling AWS CLI Version 2 (Bundled Installer)
If you installed AWS CLI version 2 using the macOS bundled installer:
- Open Terminal
- Run the uninstall command:
sudo rm -rf /usr/local/aws-cli
sudo rm /usr/local/bin/aws
sudo rm /usr/local/bin/aws_completer- Verify the uninstallation by running:
aws --versionIf the command is not found, the uninstallation is successful.
Method 2: Using Homebrew
If you installed AWS CLI using Homebrew:
brew uninstall awscliMethod 3: Using Pip
For Python-based installations:
pip uninstall awscli -y
# OR
pip3 uninstall awscli -yThis method is compatible with multiple platforms and is commonly used by developers who need to manage various Python packages.
Verifying Complete Uninstallation
After following the appropriate uninstallation method for your system, it’s essential to verify that AWS CLI has been completely removed:
- Open a new terminal or command prompt window
- Run the following command:
aws --versionIf the AWS CLI has been successfully uninstalled, you should see a “command not found” error or a similar message, as shown in the screenshot below.

Removing AWS CLI Configuration Files
Uninstalling the AWS CLI doesn’t automatically remove your configuration files, which include your credentials and settings. These are stored in the .aws directory in your home folder:
- Windows:
C:\Users\USERNAME\.aws - macOS and Linux:
~/.aws/
If you want to remove these files as well (recommended if you’re completely moving away from AWS):
Windows:
Remove-Item -Recurse -Force "$env:USERPROFILE\.aws"macOS and Linux:
rm -rf ~/.awsBest Practices
- Back up your configuration: Before uninstalling, consider backing up your
.awsdirectory if you plan to reinstall later. - Revoke access keys: If you’re permanently removing AWS CLI for security reasons, consider deactivating or rotating your access keys in the IAM console.
- Use the appropriate method: Always use the same method to uninstall as you used to install (package manager for package manager installations, etc.).
Conclusion
Uninstalling AWS CLI is a straightforward process once you know which method to use for your specific installation type and operating system. Whether you’re troubleshooting issues or simply cleaning up your system, proper uninstallation ensures you maintain a clean environment.
In this article, we discussed how to uninstall AWS CLI on Windows, Linux, and macOS. By following this article, you should now have successfully removed AWS CLI from your system. Thanks for reading this article !!!
You may also like the following articles

I am Rajkishore, and I am a Microsoft Certified IT Consultant. I have over 14 years of experience in Microsoft Azure and AWS, with good experience in Azure Functions, Storage, Virtual Machines, Logic Apps, PowerShell Commands, CLI Commands, Machine Learning, AI, Azure Cognitive Services, DevOps, etc. Not only that, I do have good real-time experience in designing and developing cloud-native data integrations on Azure or AWS, etc. I hope you will learn from these practical Azure tutorials. Read more.
