11

I'm trying to install tomcat 7 on Ubuntu Server 12.04 with:

sudo apt-get install tomcat7

which most sites and guides tell to do, but immediately I receive this answer:

Reading package lists... Done 
Building dependency tree 
Reading state information... Done 
Some packages could not be installed. 
This may mean that you have  requested an impossible situation or 
if you are using the unstable distribution that some required packages 
have not yet been created or been moved out of Incoming. 
The following information may help to resolve the situation.
The following packages have unmet dependencies:
tomcat7 : Depends: tomcat7-common (>= 7.0.26-1ubuntu1.1) but it is not
going to be installed
E: Unable to correct problems, you have held broken packages

What does this mean?

I've tried updating the repositories, changing them of country, repairing broken-packages.

I know there is the possibility of manual installation but this should be working easily

Any leads on this are greatly appreciated!

4 Answers 4

10

This is because the package tomcat6-common is still residing in the system.

do this

sudo apt-get remove tomcat6-common

This will remove the conflicting package. Installing Tomcat7 Should work fine now

2
  • 2
    How will this affect the installed tomcat6? Will it stop working? Nov 22, 2012 at 8:55
  • @Rishin This doesn't work
    – catch23
    Jul 24, 2013 at 17:13
3

I had the same problem and I haven't tomcat 6 installed on my system before. I fixed it by manually installing libtomcat7-java. (At first I want to install tomcat7-common manually and it complains about libtomcat7-java)

0

Check which packages you had on hold for apt-get, you should use

sudo dpkg --get-selections | grep hold

The “hold” package state for apt-get can be changed using:

sudo echo package_name hold | dpkg --set-selections

Replace hold with install to unset the “hold” state

sudo apt-get update

And then try to install it again.

1
  • The first line didn´t get any packages. I even checked them one by one in case the grep was wrong but every packged is marked as "install"
    – Anibaru
    Aug 10, 2012 at 20:58
0

I found that I had previously installed Tomcat 6, which was conflicting but not being picked up for some reason.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .