0

When i try to install tomcat 7 on ubuntu 15.10 it shows following error. I re install tomcat7 more than three times but it still shows same error

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)

Please anyone help me to install tomcat7.

Pang
  • 9,564
  • 146
  • 81
  • 122
LearnCode Master
  • 552
  • 2
  • 8
  • 25

3 Answers3

1

It seems like you have some issues with your package manager, this could be because of corrupted sources. Are you able to install other packages ? What kind of OS are you running exactly?

uname -a 

You can also try to run this:

apt-get update && apt-get upgrade -y && apt-get dist-upgrade -y

After the dist upgrade I can advise you to reboot the server. After the reboot try to runsudo apt-get install tomcat7

Goodluck!

nioidai
  • 41
  • 4
1

I had the same problem, my fault was install openjdk9. I removed all, then purge and -f install. After the clean, just install tomcat7 with sudo apt-get install, he got all he need

  sudo apt-get remove openjdk*
  sudo apt-get purge openjdk*
  sudo apt-get autoremove
  sudo apt-get -f install
  sudo apt-get install tomcat7
0

faced this same problem and found a simple solution. This happens because newly installed tomcat is not able to find JAVA_HOME. Just go to /etc/default/tomcat7, uncomment the JAVA_HOME variable and supply the right path to your installed java directory.

This will solve the problem.