One task that we often do is remove rpms that are installed by default. In this example, we will find out what rpm apache uses and we will uninstall it.
What we need to do is find the name of the apache package:
[root@srv-3 RPMS]# rpm -qa | grep apache apache-1.3.19-5 [root@srv-3 RPMS]#
So, we need to remove apache-1.3.19-5:
[root@srv-3 RPMS]# rpm -e apache-1.3.19-5 error: removing these packages would break dependencies: apache = 1.3.19-5 is needed by mod_ssl-2.8.1-5 webserver is needed by mod_perl-1.24_01-2 webserver is needed by mod_dav-1.0.2-4
OK. We need to remove the other packages too:
[root@srv-3 RPMS]# rpm -e mod_dav-1.0.2-4 [root@srv-3 RPMS]# rpm -e mod_perl-1.24_01-2 [root@srv-3 RPMS]# rpm -e mod_ssl-2.8.1-5 error: removal of /var/cache/ssl_gcache_data.sem failed: No such file or directory error: removal of /var/cache/ssl_gcache_data.pag failed: No such file or directory error: removal of /var/cache/ssl_gcache_data.dir failed: No such file or directory error: cannot remove /etc/httpd/conf/ssl.key - directory not empty error: cannot remove /etc/httpd/conf/ssl.crt - directory not empty [root@srv-3 RPMS]# rpm -e apache-1.3.19-5 error: cannot remove /var/www/html - directory not empty error: cannot remove /var/www - directory not empty error: cannot remove /var/log/httpd - directory not empty error: cannot remove /usr/lib/apache - directory not empty error: cannot remove /etc/httpd/conf - directory not empty error: cannot remove /etc/httpd - directory not empty [root@srv-3 RPMS]#
Let’s make sure apache is gone:
[root@srv-3 apache_1.3.19]# rpm -qa | grep apache [root@srv-3 apache_1.3.19]#
Apache is all gone.