使用apt-get安装Tomcat 7失败
安装Tomcat7时出现以下错误:
Setting up tomcat7 (7.0.26-1ubuntu1.1) ... chmod: cannot access `/etc/tomcat7/tomcat-users.xml': No such file or directory dpkg: error processing tomcat7 (--configure): subprocess installed post-installation script returned error exit status 1 No apport report written because MaxReports is reached already >Errors were encountered while processing: tomcat7 E: Sub-process /usr/bin/dpkg returned an error code (1)
当我尝试apt-get删除Tomcat7时,我收到此错误:
Removing tomcat7 ... * tomcat7 is not installed invoke-rc.d: initscript tomcat7, action "stop" failed.
如何解决此问题以正确安装Tomcat 7?
我有完全相同的问题。
我必须运行此命令(见下文)以查看所有与tomcat相关的库,并删除所有与tomcat相关的库:
要查看所有与tomcat相关的库是什么:
dpkg -l | grep -i tomcat
要删除tomcat库:
dpkg -P
然后,我使用命令重新安装了tomcat7:
sudo apt-get install tomcat7
[在安装过程中,它吐出消息说它将安装一些与tomcat7相关的其他库 – 我选择了 – 是的]。
它安装了tomcat7并启动它。
然后,我停止并使用以下命令重新启动tomcat7:
/etc/init.d/tomcat7 stop /etc/init.d/tomcat7 start
我有错误说明tomcat7 is aready newer version
。 脚步 :
- 使用命令
sudo apt-get autoremove tomcat7
卸载sudo apt-get autoremove tomcat7
。 - 这完全卸载了
tomcat7
。 - 现在使用
sudo apt-get install tomcat7
安装它。
它适用于我,尝试一下。
运行以下命令:
sudo apt-get purge libtomcat7-java tomcat6 tomcat6-admin tomcat6-docs tomcat6-examples tomcat7 tomcat7-admin tomcat7-common tomcat7-docs tomcat7-examples tomcat7-user sudo apt-get install tomcat7