Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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!

share|improve this question

4 Answers 4

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

share|improve this answer
2  
How will this affect the installed tomcat6? Will it stop working? –  Ludwig Magnusson Nov 22 '12 at 8:55
    
@Rishin This doesn't work –  nazar_art Jul 24 '13 at 17:13

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)

share|improve this answer

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.

share|improve this answer
    
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 '12 at 20:58

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.