当我尝试在ubuntu 15.10上安装tomcat 7时,它显示以下错误。我重新安装tomcat7超过三次,但它仍然显示相同的错误
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
authbind libcommons-collections3-java libcommons-dbcp-java
libcommons-pool-java libecj-java libservlet3.0-java libtomcat7-java
tomcat7-common
Suggested packages:
libcommons-collections3-java-doc libcommons-dbcp-java-doc
libgeronimo-jta-1.1-spec-java ecj ant libecj-java-gcj tomcat7-docs
tomcat7-admin tomcat7-examples tomcat7-user libtcnative-1
The following NEW packages will be installed:
authbind libcommons-collections3-java libcommons-dbcp-java
libcommons-pool-java libecj-java libservlet3.0-java libtomcat7-java tomcat7
tomcat7-common
0 upgraded, 9 newly installed, 0 to remove and 244 not upgraded.
Need to get 0 B/6,782 kB of archives.
After this operation, 8,286 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Preconfiguring packages ...
Selecting previously unselected package libcommons-collections3-java.
(Reading database ... 208809 files and directories currently installed.)
Preparing to unpack .../libcommons-collections3-java_3.2.1-8_all.deb ...
Unpacking libcommons-collections3-java (3.2.1-8) ...
Selecting previously unselected package libcommons-pool-java.
Preparing to unpack .../libcommons-pool-java_1.6-2_all.deb ...
Unpacking libcommons-pool-java (1.6-2) ...
Selecting previously unselected package libcommons-dbcp-java.
Preparing to unpack .../libcommons-dbcp-java_1.4-5ubuntu1_all.deb ...
Unpacking libcommons-dbcp-java (1.4-5ubuntu1) ...
Selecting previously unselected package libecj-java.
Preparing to unpack .../libecj-java_3.10.1-2_all.deb ...
Unpacking libecj-java (3.10.1-2) ...
Selecting previously unselected package libservlet3.0-java.
Preparing to unpack .../libservlet3.0-java_7.0.64-1_all.deb ...
Unpacking libservlet3.0-java (7.0.64-1) ...
Selecting previously unselected package libtomcat7-java.
Preparing to unpack .../libtomcat7-java_7.0.64-1_all.deb ...
Unpacking libtomcat7-java (7.0.64-1) ...
Selecting previously unselected package tomcat7-common.
Preparing to unpack .../tomcat7-common_7.0.64-1_all.deb ...
Unpacking tomcat7-common (7.0.64-1) ...
Selecting previously unselected package tomcat7.
Preparing to unpack .../tomcat7_7.0.64-1_all.deb ...
Unpacking tomcat7 (7.0.64-1) ...
Selecting previously unselected package authbind.
Preparing to unpack .../authbind_2.1.1+nmu1_amd64.deb ...
Unpacking authbind (2.1.1+nmu1) ...
Processing triggers for ureadahead (0.100.0-19) ...
ureadahead will be reprofiled on next reboot
Processing triggers for systemd (225-1ubuntu9) ...
Processing triggers for man-db (2.7.4-1) ...
Setting up libcommons-collections3-java (3.2.1-8) ...
Setting up libcommons-pool-java (1.6-2) ...
Setting up libcommons-dbcp-java (1.4-5ubuntu1) ...
Setting up libecj-java (3.10.1-2) ...
Setting up libservlet3.0-java (7.0.64-1) ...
Setting up libtomcat7-java (7.0.64-1) ...
Setting up tomcat7-common (7.0.64-1) ...
Setting up tomcat7 (7.0.64-1) ...
* Starting Tomcat servlet engine tomcat7 cat: /var/lib/tomcat7/conf/policy.d/*.policy: No such file or directory
invoke-rc.d: initscript tomcat7, action "start" failed.
dpkg: error processing package tomcat7 (--configure):
subprocess installed post-installation script returned error exit status 1
Setting up authbind (2.1.1+nmu1) ...
Errors were encountered while processing:
tomcat7
E: Sub-process /usr/bin/dpkg returned an error code (1)
请有人帮我安装tomcat7。
答案 0 :(得分:1)
您的软件包管理器似乎存在一些问题,这可能是因为源代码已损坏。你能安装其他套餐吗?你正在运行什么样的操作系统?
uname -a
你也可以尝试运行:
apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y
在dist升级后,我可以建议您重启服务器。重启后尝试运行sudo apt-get install tomcat7
古德勒克!
答案 1 :(得分:1)
我遇到了同样的问题,我的错是安装openjdk9。我删除了所有,然后清除和-f安装。干净之后,只需用sudo apt-get install安装tomcat7,他就得到了他所需要的一切
sudo apt-get remove openjdk*
sudo apt-get purge openjdk*
sudo apt-get autoremove
sudo apt-get -f install
sudo apt-get install tomcat7
答案 2 :(得分:0)
遇到同样的问题,找到了一个简单的解决方案。发生这种情况是因为新安装的tomcat无法找到JAVA_HOME。只需转到/ etc / default / tomcat7,取消注释JAVA_HOME变量并为安装的java目录提供正确的路径。
这将解决问题。