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:

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:

Run sudo amazon-linux-extras info postgresql10 to list the yum package names to uninstall, then uninstall them by running sudo yum remove [package-list].
Recently Active 'amazon-linux-extras' Questions - Stack Overflow
Newest 'amazon-linux-extras' Questions - Stack Overflow
python 3.7 uninstall from amazon-linux2
How to uninstall mysql on amazon ec2 micro instance - Stack Overflow
If you still have the original compiled source directory somewhere you may be able to use sudo make uninstall in each directory which (in theory) should remove all of the files installed.
Note I say in theory because it's not guaranteed the Makefile has proper provision for "uninstalling" in this way. Generally the recommendation is to use packages shipped with the distribution unless you're fully aware of what you're doing and have a strategy for handling upgrades & uninstalling applications installed this way.
You can use this command to remove them.
apt-get remove apache2 php5
If it's Amazon AMI Linux first you need to stop nginx service:
sudo service nginx stop
than you should disable it with:
sudo chkconfig nginx off
and if you like, uninstall it:
sudo yum remove nginx
HTH
If you used apt-get then you can use this:
sudo apt-get purge nginx
It will delete ALL files including config files.
Otherwise:
sudo rm -rf /etc/nginx /etc/default/nginx /usr/sbin/nginx* /usr/local/nginx /var/run/nginx.pid /var/log/nginx
Should do it.
Hey All,
I use Ansible to provision my servers, and now that nginx and python3 have been moved into amazon-linux-extras in Amazon Linux 2, I'm wondering the best way to script the install process?
Before I could just use ansible's yum module and give it a list of packages to install.
What should I do now? Just use the shell module and hardcode a cli command?