包“tomcat7”在 ubuntu 12.04 上没有安装候选

cat*_*h23 2 tomcat7 software-installation

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

sudo apt-get install tomcat7
Run Code Online (Sandbox Code Playgroud)

我尝试根据此安装教程执行此操作,但立即收到此答案:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package tomcat7 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'tomcat7' has no installation candidate
Run Code Online (Sandbox Code Playgroud)

更新:

我尝试tomcat7按照本教程逐步下载和安装。但是当我尝试运行程序时

`$ ./catalina.sh run` 
Run Code Online (Sandbox Code Playgroud)

我收到了一些警告 + SEVERE: Cannot start server. Server instance is not configured

nazar_art@nazar-desctop:/usr/local/tomcat/apache-tomcat-7.0.42/bin$ ./catalina.sh run
Using CATALINA_BASE: /usr/local/tomcat/apache-tomcat-7.0.42
Using CATALINA_HOME: /usr/local/tomcat/apache-tomcat-7.0.42
Using CATALINA_TMPDIR: /usr/local/tomcat/apache-tomcat-7.0.42/temp
Using JRE_HOME: /usr/lib/jvm/java-7-oracle
Using CLASSPATH: /usr/local/tomcat/apache-tomcat-7.0.42/bin/bootstrap.jar:/usr/local/tomcat/apache-tomcat-7.0.42/bin/tomcat-juli.jar
Jul 25, 2013 8:49:54 PM org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [/usr/local/tomcat/apache-tomcat-7.0.42/conf/server.xml]
Jul 25, 2013 8:49:54 PM org.apache.catalina.startup.Catalina load
WARNING: Permissions incorrect, read permission is not allowed on the file.
Jul 25, 2013 8:49:54 PM org.apache.catalina.startup.Catalina load
WARNING: Unable to load server configuration from [/usr/local/tomcat/apache-tomcat-7.0.42/conf/server.xml]
Jul 25, 2013 8:49:54 PM org.apache.catalina.startup.Catalina load
WARNING: Permissions incorrect, read permission is not allowed on the file.
Jul 25, 2013 8:49:54 PM org.apache.catalina.startup.Catalina start
SEVERE: Cannot start server. Server instance is not configured.
Run Code Online (Sandbox Code Playgroud)
  • 如何解决这个问题并安装tomcat7

Bra*_*iam 5

tomcat7包仅在安全存储库中可用,在主存储库中提供精确、俏皮到狡猾的 Universe 部分,在 Universe 存储库中提供更新。因此,请确保您在/etc/apt/sources.list以下行中有:

 deb http://security.ubuntu.com/ubuntu precise-security main universe
Run Code Online (Sandbox Code Playgroud)

该行不必是精确的,它可以包含multiverserestricted,但它应该包含上面的所有元素。如果source.list文件中不存在该行,请添加它并运行apt-get update. 现在你应该tomcat7有空了。

Tomcat7下载页面

如果找不到source.list文件

  1. 执行:

    sudo nano /etc/apt/source.list

  2. 然后粘贴到文件中:

    deb http://security.ubuntu.com/ubuntu precise-security main universe

  3. 点击:Ctrl+O保存文件,然后Ctrl+X退出。

  4. 用 更新包列表sudo apt-get update

我已经安装了 tomcat6

然后你必须tomcat6在尝试安装之前删除你的系统tomcat7

sudo apt-get remove tomcat*
sudo apt-get install tomcat7
Run Code Online (Sandbox Code Playgroud)

这将删除所有与 tomcat 相关的软件包,安装tomcat7不会出现问题。