如何从 ubuntu 18.04 中删除 tomcat 9

如何从 ubuntu 18.04 中删除 tomcat 9

我知道这个问题已经被问了很多次了,但我遇到了一些问题。当我将 war 文件上传到 tomcat 时,我无法启动,并且出现此错误

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

然后我尝试删除 tomcat 9,以便可以安装 tomcat 8,但我无法按照其他线程上给出的说明进行操作,因为当我运行

dpkg -l|grep tomcat 

不返回任何内容。

sudo apt-get remove tomcat

返回

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

运行相同的操作,但使用 tomcat9,而不仅仅是 tomcat 返回

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.

但是,服务器已启动并正在运行,我可以通过浏览器连接到 UI,但无法启动 war 文件。

答案1

由于 tomcat 是通过将 tar.gz 文件解压到 /opt/tomcat 来安装的,因此卸载过程将删除 /opt/tomcat。

cd /opt
sudo rm -rf tomcat

相关内容