How to remove tomcat 9 from ubuntu 18.04

17,843

Since tomcat has been installed by unpacking a tar.gz file to /opt/tomcat, the uninstall process will be to remove /opt/tomcat.

cd /opt
sudo rm -rf tomcat
Share:
17,843

Related videos on Youtube

Stelios Botonakis
Author by

Stelios Botonakis

Updated on September 18, 2022

Comments

  • Stelios Botonakis
    Stelios Botonakis almost 2 years

    I know this question has been asked a lot but I am facing some problems. When I upload a war file to tomcat I cant get to to start and i get this error

    FAIL - Application at context path [/fuseki] could not be started
    

    I then have tried to remove tomcat 9 so I can install tomcat 8 but I cant follow the instructions given on other threads because when I run

    dpkg -l|grep tomcat 
    

    returns nothing.

    sudo apt-get remove tomcat
    

    returns

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package 'tomcat9' is not installed, so not removed
    0 upgraded, 0 newly installed, 0 to remove and 145 not upgraded.
    root@ubuntu:~# sudo apt-get remove tomcat
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Unable to locate package tomcat
    

    running the same but with tomcat9 instead of just tomcat returns

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package 'tomcat9' is not installed, so not removed
    0 upgraded, 0 newly installed, 0 to remove and 145 not upgraded.
    

    The server however is up and running and I can connect via the browser to the UI but I cant get to get a war file started.

    • Soren A
      Soren A about 5 years
      How did you install Tomcat ?
    • Stelios Botonakis
      Stelios Botonakis about 5 years
    • Soren A
      Soren A about 5 years
      So basically, you downloaded a tar.gz archive and unpacked it to /opt/tomcat. So cd /opt and sudo rm -rf tomcat should 'uninstall' it.
    • Stelios Botonakis
      Stelios Botonakis about 5 years
      I did what you said but I hope it is the correct way and it purged everything and I can install tomcat 8 .
    • Stelios Botonakis
      Stelios Botonakis about 5 years
      I did as you said and then installed tomcat 8.5 but I get the same error when I upload a .war file