sudo yum remove postgresql

In order to confirm we are removing what we did install with amazon-linux-extras, we can check the Repository after we run the sudo yum remove command:

Answer from Ervin Szilagyi on Stack Overflow
Discussions

Recently Active 'amazon-linux-extras' Questions - Stack Overflow
It appears that Amazon Linux 2 ... Linux Extras, which makes a lot of documentation and answers ... ... I want to install neofetch and screenfetch but I have yum as the default package manager in amazon linux and it does not have neofetch and screenfetch repositaries in it for me to install. ... How do you UNinstall a package ... More on stackoverflow.com
🌐 stackoverflow.com
Newest 'amazon-linux-extras' Questions - Stack Overflow
I am asking because a recent change ... amazon-linux-extras enable ansible2 ... ... Greeting all; I have working with an EC2 instance of Amazon Linux 2 AMI (HVM) - Kernel 5.10, SSD Volume Type (64-bit Arm). I need to install a mariadb version 10.5 on my instance Goal: My goal is to ... ... How do you UNinstall a package ... More on stackoverflow.com
🌐 stackoverflow.com
python 3.7 uninstall from amazon-linux2
I wanted to remove the python 3.7 version from my amazon-Linux completely and reinstall the python 3.9 version with yum commands More on repost.aws
🌐 repost.aws
2
0
March 24, 2023
How to uninstall mysql on amazon ec2 micro instance - Stack Overflow
Somehow I have screwed up mysql on my ec2 micro instance on amazon. Ho wdo i uninstall it and reinstall a fresh mysql on the machine? Please help me to get this done. Regards, Pradeep More on stackoverflow.com
🌐 stackoverflow.com
🌐
CopyProgramming
copyprogramming.com › howto › uninstalling-a-package-installed-with-amazon-linux-extras
Removing an Amazon-Linux-Extras Installed Package - Amazon web services
March 30, 2023 - Hottest 'amazon-linux-extras' Answers, Uninstalling a package installed with amazon-linux-extras sudo yum remove postgresql In order to confirm we are removing what we did install with amazon-linux-extras, we can check the Repository after …
🌐
Stack Overflow
stackoverflow.com › questions › tagged › amazon-linux-extras
Recently Active 'amazon-linux-extras' Questions - Stack Overflow
sudo amazon-linux-extras install postgresql10 Installs it. Now... how do I remove it? sudo amazon-linux-extras uninstall ...
🌐
Stack Overflow
stackoverflow.com › questions › tagged › amazon-linux-extras
Newest 'amazon-linux-extras' Questions - Stack Overflow
sudo amazon-linux-extras install postgresql10 Installs it. Now... how do I remove it? sudo amazon-linux-extras uninstall ...
🌐
AWS re:Post
repost.aws › questions › QUKxdRgqGKR_-fej5MY62fBw › python-3-7-uninstall-from-amazon-linux2
python 3.7 uninstall from amazon-linux2 | AWS re:Post
March 24, 2023 - # Remove Python 3.7 sudo yum remove python3 -y # Enable Amazon Linux Extras repository for Python 3.9 sudo amazon-linux-extras enable python3.9 # Clean the yum metadata cache sudo yum clean metadata # Install Python 3.9 sudo yum install python3.9 -y # Check the installed Python version python3 --version
Find elsewhere
🌐
LinuxVox
linuxvox.com › blog › amazonlinuxextras
Unleashing the Power of Amazon Linux Extras — linuxvox.com
You need to use yum to uninstall those packages separately. To get more information about a specific extra, you can use the info sub-command: ... This command will show details such as the available packages, dependencies, and any additional ...
🌐
AWS
docs.aws.amazon.com › amazon linux › user guide › al2 extras library
AL2 Extras Library - Amazon Linux 2
Describes AL2 Extras. Find out about lifespan, support, and package changes.
🌐
Pkv
bandarqq.pkv.biz
1. Install amazon-linux-extras-yum-plugin.noarch package
Pkv games merupakan provider situs judi kartu qq online resmi yang menyediakan game qiu qiu, dominoqq, bandarqq, sakong, capsa susun, poker online, gaple, aduqq, dan lainnya.
🌐
AWS
docs.aws.amazon.com › corretto › corretto 8 user guide › amazon corretto 8 guide for linux › amazon corretto 8 installation instructions for amazon linux 2 and amazon linux 2023
Amazon Corretto 8 Installation Instructions for Amazon Linux 2 and Amazon Linux 2023 - Amazon Corretto 8
Option 1: Install using the yum Package Manager on Amazon LinuxOption 2: Download and Install RPMs ManuallyVerify Your InstallationUninstall Amazon Corretto 8 · This topic describes how to install and uninstall Amazon Corretto 8 on a host or container running the Amazon Linux 2 or Amazon Linux ...
🌐
Amazon Web Services
docs.amazonaws.cn › 亚马逊云科技 › amazon linux 2 › user guide › what is amazon linux 2?
What is Amazon Linux 2? - Amazon Linux 2
Amazon Linux 2 (AL2) is a Linux operating system from Amazon Web Services (Amazon). AL2 is designed to provide a stable, secure, and high-performing environment for applications running on Amazon EC2. It also includes packages that enable efficient integration with Amazon, including launch configuration tools and many popular Amazon libraries and tools.
🌐
YouTube
youtube.com › watch
How to uninstall OpenJDK from Amazon EC2 Instance or Linux Operating System? - YouTube
Welcome to our tutorial on uninstalling OpenJDK from an Amazon EC2 instance or Linux operating system! If you no longer need OpenJDK installed on your EC2 in...
Published   October 4, 2022
Top answer
1 of 1
4

1. remove dispensable packages

Amazon Linux instances manage their software using the yum package manager. The yum package manager can install, remove, and update software, as well as manage all of the dependencies for each package. – Managing Software on Your Linux Instance

I have executed the following to produce a list of the 20 largest packages in the system:

rpm -qa --queryformat '%10{size} - %-25{name} \t %{version}\n' | sort -nr | head -n 20

To remove packages with all of its dependencies I have then installed the yum plugin remove-with-leaves and then repeatedly removed the largest packages (including dependencies) which I deemed dispensable (see below for list):

sudo yum remove package_name --remove-leaves

2. remove obsolete kernel

  1. Identified current kernel:uname -mrs
  2. Listed all kernels: rpm -q kernel
  3. Manually removed obsolete Linux kernel: sudo yum remove kernel-4.9.76-3.78.amzn1.x86_64

3. remove unused packages

Identified packages that can be removed without affecting anything else (in debian-speak these are called “orphaned packages”) and removed quietly.

sudo package-cleanup --quiet --leaves | sudo xargs -l1 yum -y remove 

Findings

While I am actively only using Python 3.6.5 it is not possible to remove the default python (Python 2.7.14).

Python is required by many of the Linux distributions. Many system utilities the distro providers combine (both GUI based and not), are programmed in Python. The version of python the system utilities are programmed in I will call the "main" python. [...] Because of the system utilities that are written in python it is impossible to remove the main python without breaking the system. – How to yum remove Python gracefully?

Space occupied by python27 packages amounts to 115819035 bytes (~116 MB).

Results

  • A total of ~0.5 GB was reclaimed (7% of disk space on /dev/xvda1).
  • 214 packages with a total of 633427867 bytes were removed:
    java-1.7.0-openjdk emacs-common mysql55-server java-1.7.0-openjdk-devel git 
    mysql55 vim-common perl compat-libicu4 aws-apitools-ec2 emacs v8 ruby20-libs 
    perl-Encode nodejs-devel aws-apitools-elb aws-apitools-as nodejs 
    aws-apitools-mon perl-DBD-SQLite dejavu-sans-fonts subversion subversion-libs 
    subversion-perl python36-devel dejavu-serif-fonts vim-enhanced libtool autoconf 
    perl-DBI rubygem20-rdoc automake libX11-common perl-libs gyp cvs libX11 git-svn 
    alsa-lib gnutls dejavu-sans-mono-fonts perl-Net-SSLeay npm libyaml-devel 
    xorg-x11-fonts-Type1 perl-IO-Compress rsync libxcb libpng perl-Test-Harness 
    rubygems20 perl-Pod-Simple fontconfig aws-amitools-ec2 lcms2 perl-DBD-MySQL55 
    git-cvs xorg-x11-font-utils libXfont perl-podlators perl-IO-Socket-SSL git-p4 
    v8-devel perl-YAML perl-Storable rubygem20-json perl-Git-SVN perl-PathTools 
    nodejs-hawk perl-Pod-Perldoc ruby20-irb perl-File-Temp libuv-devel libserf 
    system-rpm-config autogen-libopts perl-Getopt-Long perl-Compress-Raw-Zlib 
    perl-Filter perl-GSSAPI dejavu-fonts-common libuv perl-Net-Daemon libICE cvsps 
    perl-Socket rubygem20-psych perl-Digest-SHA git-email perl-Authen-SASL ttmkfdir 
    perl-HTTP-Tiny perl-Data-Dumper nodejs-ctype perl-threads emacs-git 
    perl-Time-HiRes perl-IO-Socket-IP libXext giflib rubygem20-bigdecimal libSM 
    nodejs-async perl-threads-shared perl-PlRPC nodejs-hoek node-gyp libXi perl-Git 
    nodejs-request nodejs-fstream perl-Scalar-List-Utils ruby20 nodejs-mime 
    perl-Exporter perl-TermReadKey perl-Compress-Raw-Bzip2 nodejs-tar 
    perl-Digest-MD5 perl-File-Path perl-Error http-parser perl-Net-LibIDN 
    perl-Pod-Usage perl-Time-Local libfontenc libXrender libXau 
    nodejs-npm-registry-client nodejs-minimatch nodejs-boom nodejs-http-signature 
    nodejs-semver libXcomposite nodejs-glob nodejs-nopt perl-Digest perl-Carp 
    libXtst perl-Thread-Queue nodejs-npmconf libffi-devel perl-constant gpm-libs 
    perl-Pod-Escapes nodejs-normalize-package-data nodejs-packaging 
    nodejs-read-package-json nodejs-promzard nodejs-lockfile nodejs-asn1 
    nodejs-ansi perl-Text-ParseWords copy-jdk-configs nodejs-form-data nodejs-sntp 
    nodejs-fstream-npm nodejs-node-uuid nodejs-config-chain perl-Digest-HMAC 
    nodejs-retry nodejs-graceful-fs nodejs-sigmund nodejs-npmlog http-parser-devel 
    nodejs-read-installed nodejs-lru-cache nodejs-init-package-json nodejs-qs 
    nodejs-slide nodejs-combined-stream nodejs-assert-plus nodejs-fstream-ignore 
    nodejs-block-stream perl-parent nodejs-delayed-stream nodejs-ini nodejs-sha 
    nodejs-cmd-shim nodejs-tunnel-agent nodejs-mute-stream nodejs-rimraf 
    nodejs-read nodejs-osenv nodejs-mkdirp perl-macros nodejs-which nodejs-abbrev 
    perl-Net-SMTP-SSL nodejs-archy nodejs-uid-number nodejs-aws-sign 
    nodejs-forever-agent nodejs-opener nodejs-json-stringify-safe nodejs-proto-list 
    nodejs-cryptiles nodejs-editor nodejs-child-process-close 
    nodejs-github-url-from-git nodejs-cookie-jar nodejs-npm-user-validate 
    nodejs-chmodr nodejs-chownr nodejs-once nodejs-inherits nodejs-oauth-sign 
    aws-apitools-common mysql-config vim-filesystem ruby git-all 
    fontpackages-filesystem 
    

Resources

  1. Amazon Linux AMI
    • Amazon Linux AMI 2018.03 Release Notes
  2. GAD3R's answer to how to remove all installed dependent packages while removing a package in centos 7?
  3. How to remove old unused kernels on CentOS Linux
  4. jtoscarson's answer to Remove unused packages
  5. Owen Fraser-Green's answer to How can I remove Orphan Packages in Fedora?
🌐
Medium
medium.com › @srikar.appal › uninstall-mysql-from-ec2-6910c4597c6c
Uninstall and Reinstall MySQL from EC2 hosts | by Srikar Appalaraju | Medium
April 25, 2018 - Uninstall and Reinstall MySQL from EC2 hosts Please follow the following steps to completely remove MySQL from an EC2 host. First stop the mysql-server. sudo service mysqld stop kill the running …