在Ubuntu Server 12.04上安装tomcat 7


11

我正在尝试使用以下命令在Ubuntu Server 12.04上安装tomcat 7:

sudo apt-get install tomcat7

大多数网站和指南都要求这样做,但是我立即收到以下答案:

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

这是什么意思?

我尝试过更新存储库,更改国家/地区,修复损坏的程序包。

我知道可以手动安装,但这应该很容易

任何线索对此表示极大的赞赏!

Answers:


10

这是因为软件包tomcat6-common仍驻留在系统中。

做这个

sudo apt-get remove tomcat6-common

这将删除有冲突的程序包。安装Tomcat7现在应该可以正常工作


2
这将如何影响已安装的tomcat6?它会停止工作吗?
路德维希·马格努森

@Rishin这行不通
nazar_art

3

我遇到了同样的问题,并且以前没有在系统上安装tomcat 6。我通过手动安装修复了它libtomcat7-java。(起初我想tomcat7-common手动安装,但它抱怨libtomcat7-java


0

检查您持有apt-get的哪些软件包,应该使用

sudo dpkg --get-selections | grep hold

可以使用以下方式更改apt-get的“保持”软件包状态:

sudo echo package_name hold | dpkg --set-selections

用安装替换保持以取消“保持”状态

sudo apt-get update

然后尝试再次安装。


第一行没有得到任何包裹。我什至逐一检查了它们,以防grep错误,但每个包装都标记为“安装”
Anibaru 2012年

0

我发现我以前安装了Tomcat 6,但由于某些原因,它冲突但没有被执行。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.