无法删除 tomcat7

无法删除 tomcat7

我无法从我的 Ubuntu 15.04 中完全删除 tomcat7。我错误地var/lib/dpkg/info/tomcat7从文件管理器中删除了它的配置文件。但现在,当我尝试使用apt-get remove甚至通过 synaptic 包管理器删除此包时,我收到此错误:

(synaptic:9062): GLib-CRITICAL **: g_child_watch_add_full: assertion 'pid > 0' failed
(Reading database ... 399913 files and directories currently installed.)
Removing tomcat7 (7.0.56-2ubuntu0.1) ...
/var/lib/dpkg/info/tomcat7.prerm: 1: /etc/default/tomcat7: Run: not found
dpkg: error processing package tomcat7 (--purge):
 subprocess installed pre-removal script returned error exit status 127
dpkg: tomcat7-common: dependency problems, but removing anyway as you requested:
 tomcat7 depends on tomcat7-common (>= 7.0.56-2ubuntu0.1).

Removing tomcat7-common (7.0.56-2ubuntu0.1) ...
Errors were encountered while processing:
 tomcat7
E: Sub-process /usr/bin/dpkg returned an error code (1)
A package failed to install. Trying to recover:

答案1

您混淆了包管理系统。您应该重新安装tomcat7,使用:

sudo apt-get install --reinstall tomcat7

然后,当文件系统内容和包管理系统一致时,

sudo apt-get remove tomcat7

相关内容