Installation And Unistallation Of Tomcat

I just installed the tomcat 10.0.12 using below command

$ mkdir /opt/tomcat
$ cd /opt/tomcat
sudo wget
$ tar xvzf apache-tomcat-8.5.65.tar.gz
$ nano ~/.bashrc
and set the environment variabels in it which are
export JAVA_HOME=/usr/lib/jvm/jdk-17
export CATALINA_HOME=/opt/tomcat/apache-tomcat-10.0.12
saved the changes
$ . ~/.bashrc

then i runned in browser it worked perfectly fine for me
but when i checked that application for which i installed the tomcat 10.0.12 it said for now its not supported to use tomcat i have to install tomcat 10.0.10 so i unistalled tomcat using below command

sudo rm -rf /opt/tomcat

and installed tomcat 10.0.10 by making few changes in above code but when i runned again the page shown me this

instead of showing me this
please ignore 8.5.05 cause i downloaded this image from another website which was providing tutorial to insatll tomcat on linux
i think tomcat didn't uninstall completely and still running what should i do please tell me

I would have opted for this guide, instead:

According to Apache:

Applications that run on Tomcat 9 and earlier will not run on Tomcat 10 without changes. Java EE based applications designed for Tomcat 9 and earlier may be placed in the $CATALINA_BASE/webapps-javaee directory and Tomcat will automatically convert them to Jakarta EE and copy them to the webapps directory. This conversion is performed using the Apache Tomcat migration tool for Jakarta EE tool which is also available as a separate download for off-line use.

okay but what should i do now tell me how should i completely uninstall remove them and then i will install tomcat using your guide

I believe you already uninstalled it. By the way: Did you adjust your bashrc after removing TomCat?

The webpage you are referencing will show as unreachable without Tomcat installed.

in bashrc i did some changes like which are

export JAVA_HOME=/usr/lib/jvm/jdk-17
export CATALINA_HOME=/opt/tomcat/apache-tomcat-10.0.12


export JAVA_HOME=/usr/lib/jvm/jdk-17
export CATALINA_HOME=/opt/tomcat/apache-tomcat-10.0.10

@Aravisian please help me how should i solve this problem please bro

I'm sorry Aditya, I thought the above posts were self evident.
As Tomcat is already Uninstalled, follow the installation guide above and adjust bashrc as necessary.