Apache Tomcat or simply Tomcat (formerly it was also known as Jakarta Tomcat) is an open-source web server and servlet container developed by the Apache Software Foundation (ASF). Tomcat can be installed on CentOS Stream /Redhat machine either using yum or from the source file. However, in this tutorial, we will see, how we can uninstall/remove tomcat from the Linux machine.
In order to remove tomcat from your machine, the first thing you need to check is how this package got installed on your server.
Removal of Tomcat installation through package manager
Using yum
Suppose, you have installed tomcat 5 or tomcat 9 using yum package manager, then the default tomcat configurations can be found at “/etc/tomcat5” and “/usr/share/tomcat5”. You can find the tomcat packages using the following command:
rpm -qa | grep tomcat
Now, you can proceed with the uninstallation of the listed packages using “yum” as follows:
Continue this for the other packages. Packages such as tomcat5-servelet may have many dependencies including open office. So, if you want to remove the packages without removing the dependencies, you need to use the command “rpm” as follows:
rpm -e package_name -nodeps
After removing the packages, you need to remove the tomcat directories too:
rm -rf /etc/tomcat5
rm -rf /usr/share/tomcat5
Using Apt
On Ubuntu to remove system and config files run below commands
Stop chkservd and remove tomcat from there if it is configured.
service chkservd stop
cd /etc/chkserv.d
rm -Rf tomcat
cd /var/run/chkservd
rm -Rf Tomcat_JSP
service chkservd start
4. To remove Tomcat Connector configuration from Apache web server
Remove all mod_jk lines from httpd.conf, including addmodule, loadmodule, and include lines.
Conclusion
In this guide, we learned how to completely remove tomcat from Linux distributions such as Ubuntu.
If this resource helped you, let us know your care by a Thanks Tweet.
Did you find this article helpful?
We are glad you liked the article. Share with your friends.
About The Author
Bobbin Zachariah
Bobbin is a seasoned IT professional with over two decades of experience. He has excelled in roles such as a computer science instructor, Linux system engineer, and senior analyst. Currently, he thrives in DevOps environments, focusing on optimizing efficiency and delivery in AWS Cloud infrastructure. Bobbin holds certifications in RHEL, CCNA, and MCP, along with a Master's degree in computer science. In his free time, he enjoys playing cricket, blogging, and immersing himself in the world of music.
Comments