In this article we are going to learn “Uninstalling AWS CLI from Your Linux Server” step by step.
The AWS Command Line Interface (AWS CLI) is a versatile tool for managing and interacting with Amazon Web Services (AWS) resources from the command line. However, there may come a time when you need to remove it from your Linux server. Whether you’re replacing it with a different CLI or simply cleaning up your system, the process of uninstalling the AWS CLI is straightforward. In this guide, we will walk you through the steps to uninstall the AWS CLI from your Linux server. By the end of this article, you’ll have a clear understanding of how to cleanly remove the AWS CLI, ensuring that your system is free from any AWS CLI-related components.
Before you proceed with uninstalling the AWS CLI from your Linux server, make sure you have the following prerequisites in place:
- Access to a Linux Server: You should have SSH access to your Linux server. If you’re physically present at the server, you can also perform these steps directly.
- AWS CLI Installed: Naturally, you should have the AWS CLI installed on your server, as you’re looking to uninstall it.
- User Privileges: You need to have sufficient user privileges to uninstall software and make system-wide changes. Typically, you should be using a user with sudo or root access.
Steps of Uninstalling AWS CLI from Your Linux Server
Let’s follow the steps to uninstall AWS CLI on Linux servers.
- Locate the symlink and install paths.
Use the which command to find the symlink. This shows the path you used with the –bin-dir parameter.
ubuntu@Rushi-InfoTech:~$ which aws
- Use the ls command to find the directory that the symlink points to. This gives you the path you used with the –install-dir parameter.
ubuntu@Rushi-InfoTech:~$ ls -l /usr/local/bin/aws
- Delete the two symlinks in the –bin-dir directory. If your user has write permission to these directories, you don’t need to use sudo.
ubuntu@Rushi-InfoTech:~$ sudo rm /usr/local/bin/aws
ubuntu@Rushi-InfoTech:~$ sudo rm /usr/local/bin/aws_completer
- Delete the –install-dir directory. If your user has write permission to this directory, you don’t need to use sudo.
ubuntu@Rushi-InfoTech:~$ sudo rm -rf /usr/local/aws-cli
- (Optional) Remove the shared AWS SDK and AWS CLI settings information in the .aws folder.
The default location of the .aws folder differs between platforms, by default the folder is located in ~/.aws/. If your user has write permission to this directory, you don’t need to use sudo.
ubuntu@Rushi-InfoTech:~$ sudo rm -rf ~/.aws/
- Verify the AWS CLI is present or not.
ubuntu@Rushi-InfoTech:~$ aws --version
In this article, we’ve outlined the steps to uninstall the AWS CLI from your Linux server, providing you with a clear and concise guide to ensure the removal process is smooth and complete.
The AWS CLI is a valuable tool for AWS resource management, but circumstances may require its removal. By following the steps outlined in this guide, you can confidently remove the AWS CLI and its associated components from your Linux server, leaving your system clean and ready for any future changes or configurations.
Remember that uninstalling the AWS CLI is a reversible process, and you can always reinstall it in the future if needed. Additionally, take care not to delete any crucial data or configurations associated with your AWS CLI activities. Finally, always ensure that you have backups and follow best practices for system management to maintain the integrity of your Linux server.
From this article we have learnt “Uninstalling AWS CLI from Your Linux Server” in detailed.
Any queries pls contact us