How to install latest version of tomcat on ubuntu using apt?

18,255

Solution 1

If you want latest version,which is not available on ubuntu repos, there are following alternate ways of getting it.

  • manual download from website
  • download from unofficial repositories.
  • download and build latest source code.
  • download from other linux repository and convert using alien.

Now as you don't want to install manually,lets speak about other methods.


download from unofficial repositories.

once you find the repository you need,open a terminal and type.

sudo add-apt-repository ppa:(Your ppa here)
sudo apt-get update
sudo apt-get install tomcat

NOTE:-

you will first have to temporarily block the repo which contains older version of tomcat,or they will interfere.you can do this by

sudo add-apt-repository -r ppa:(Your ppa here)

and dont forget to add it back, once you are done.


download and build

this link provides the source code.for building and installing software read software documentation/forums and compile easy how to


download from other source

download package using website or any other place.then use alien to convert package.read alien man pagesfor help on using alien.

Solution 2

In a nutshell

Upgrade to the latest non-LTS to get the latest Tomcat version

In details

The LTS versions of Ubuntu are focussed on stability rather than features. If you want to run the latest version of Tomcat then you are using the wrong version of Ubuntu. You may want to upgrade to the latest non-LTS to get the latest version of Tomcat available from the Ubuntu repositories.

You may be interested to read Why don't the Ubuntu repositories have the latest versions of software?

Solution 3

See tomcat@launchpad: 7.0.47-1 is available as of 14.04 so with apt-get it will not work (you would pull in more than just tomcat since your system will find lots of newer versions).

In case anyone wants to know the 2nd best method: you can download the debian installer files and have Ubuntu Software Center install it (3rd method would be to install from a download from the apache site).

  • Package details can be found here and the deb installer can be found here. It depends on:

    adduser
    debconf (>= 0.5)
    tomcat7-common (>= 7.0.47-1) 
    ucf 
    

    After you download the DEB file just doublclick it from Nautilus and if installable it is technical a manual method but as easy as it can be.

Solution 4

If you do not want to manually download & install Tomcat (either from source or using some .deb package installed via dpkg), then clearly the only possibility of installing it is through the package manager (i.e., apt-get).

The package manager retrieves the package automatically from a repository on the Internet. The Ubuntu devs have not yet made version 7.0.47 available in the official repositories for 12.04 (yet), so at best you could hope for a third-party repository, such as a PPA.

Unfortunately, there does not seem to be such an Ubuntu third-party repository for Tomcat. At least, I just searched, rather extensively, and could not find one.

So your options are:

  1. Upgrade to a new Ubuntu release (of course, more recent Ubuntu versions are not long-term support, so it may not be an option for you). In the current release, namely, Ubuntu 13.10, ou will find Tomcat 7.0.42. Also, in the upcoming Ubuntu 14.04, Tomcat 7.0.47 will be available. Ubuntu 14.04 will also be long-term support, so that may be an interesting alternative, but you will have to wait until April.

    Browse to Details of package tomcat7 at packages.ubuntu.org to find exactly what version is available in what Ubuntu release.

  2. If you do not want to upgrade your Ubuntu: wait for it ;) Ubuntu 12.04 will be supported through early 2017, so at some point Tomcat 7.0.47 will certainly be made available for Ubuntu 12.04. Keep in mind that this is a stable, long-term support release, so new packages just do not come in that fast. This is a sensible in approach in production environments. You don't always want the newest and greatest. You want something stable.

  3. If neither upgrading nor waiting are acceptable options for you, you are only left with installing Tomcat manually. Refer to How to install Tomcat 7.0.42 on Ubuntu 12.04.3 LTS? to find out how to manually install the newest Tomcat in Ubuntu 12.04 (that thread is about Tomcat 7.0.42, but the method is analoguous for Tomcat 7.0.47, of course).

Share:
18,255
kmansoor
Author by

kmansoor

Updated on September 18, 2022

Comments

  • kmansoor
    kmansoor over 1 year

    apt-get install will only install 7.0.26, what is the prescribed way to get the latest version which is 7.0.47.

    I'm on 12.04. I am trying to avoid manual download and install.

  • Peter
    Peter almost 10 years
    The issue is that by focusing on an arbitrary patch version, stability is actually compromised anyway. It is a false economy to use status quo as a proxy for stability. There is no rational excuse for picking Tomcat-7.0.26 as a patch release and sticking with it except for randomly chosen security patches.
  • Braiam
    Braiam almost 10 years
    @Peter Ubuntu LTS focus on stability at the cost of latest features the same way other distros do, ie. CentOS still uses apache httpd 2.2 even in 2013 instead of 2.4 which was released in 2012. Older versions may be by far more stable and tested than newer versions. Of course, LTS won't use obsolete, unmaintained versions.
  • Peter
    Peter almost 10 years
    Ubuntu isn't the only OS with this issue. LTS effectively uses unmaintained versions, by sticking to a patch release as if it is a minor or major release. I.e., Tomcat-7.0.x where x is fixed, and not update to 7.0.y purely on principle. The only patches that are backported are not bug fixes, just security fixes, so you have a system that contains bugs, but hopefully not security vulnerabilities. I can't imagine anyone believing that an older patch release is more stable than a newer patch release for the same major and minor version numbers, in Java at least, with a big project such as Tomcat.
  • Braiam
    Braiam almost 10 years
    @Peter for that there're SRU actually, and I don't think any distro will leave a critical bug unfixed if it already have a patch ready to apply.
  • Adrien Be
    Adrien Be over 6 years
    this is a good explanation, but not a solution
  • Adrien Be
    Adrien Be over 6 years
    @kmansoor what unofficial repository did you use to use the sudo add-apt-repository ppa:(Your ppa here) solution ?
  • Braiam
    Braiam over 6 years
    @AdrienBe "upgrade to the latest non-LTS to get the latest version". It is.
  • Registered User
    Registered User over 6 years
    @AdrienBe It doesn't matter, it should work with any ppa
  • Adrien Be
    Adrien Be over 6 years
    @Braiam I like that short explanation better :)