PDA

View Full Version : [lubuntu] Ubuntu 24.04 | Unable to install Tomcat 9 - "Package 'tomcat9' has no installation c



mdmonirul
June 4th, 2024, 08:00 AM
Hi everyone,
I'm trying to install Tomcat 9 on my Ubuntu system using sudo apt-get install tomcat9, but I keep running into the following error:
monirul@nitacl-Veriton-Series:~$ sudo apt-get install tomcat9
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package tomcat9 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 'tomcat9' has no installation candidate

Here's what I've tried so far:


sudo apt update
Searching for alternative package names (e.g., tomcat9.0, tomcat-9) using apt-cache search tomcat

System Information:


Ubuntu version: 24.04 LTS
Architecture: LAMP (Linux, Apache, MariaDB and Perl, PHP)

Could anyone please point me in the right direction? Is there a specific repository I need to enable or a different approach to installing Tomcat 9?
Thanks in advance for your help!

Morbius1
June 4th, 2024, 12:16 PM
Is tomcat10 not backward compatible to tomcat9 because that is the only one in the repository.

vmayorow
June 9th, 2024, 01:22 PM
Is tomcat10 not backward compatible to tomcat9 because that is the only one in the repository.

Unfortunately Tomcat 10 is NOT backward compatible to Tomcat 9, and most web apps working on Tomcat 9 will not work on Tomcat 10. Therefore, Tomcat 9 is still supported by Apache and new versions of Tomcat 9 are regularly released.

There is still an option to manually install Tomcat 9, but absence of Tomcat 9 package in the apt repository of Ubuntu 24.04 is an annoying problem for Tomcat 9 users.

I wonder if there's somewhere an option to suggest packages to be added to Ubuntu 24.04?

LHammonds
June 9th, 2024, 09:22 PM
Sounds like you will need to manually install the application.

I found this tutorial for Installing Tomcat 9 on Debian 10 (https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-9-on-debian-10) which should be very similar to the steps necessary on Ubuntu...with the exception of the step to install curl which is already installed on Ubuntu.

Keep in mind that Tomcat 9 will NOT receive updates automatically because it was not installed using apt. You will need to re-download the latest package again, stop the Tomcat service and install/overwrite the current installation. However, once you have it installed, much of the initial setup steps do not need to be repeated such as creating a user, configuring systemd and firewall rules.

But make sure you have a backup of any configuration files you modified that came with the package because extracting another package would overwrite all the files it came with....which is why you typically create files that will be included by the main config to avoid this situation (this is general info...I am not familiar with exact specifics of Tomcat)

If I were you, I'd document exactly how you install Tomcat on the server (preferably with a slightly older build version) and then document exactly how you should update the system with a new version. There won't be much to the documents kinda like the one I linked above but it will be critical to ensure that you or someone else will know how to update the system with security patches/fixes over time.

LHammonds

vmayorow
June 18th, 2024, 09:58 AM
I was able to resolve this by running this command (add the Ubuntu 22.04 repository):



add-apt-repository -y -s "deb http://archive.ubuntu.com/ubuntu/ jammy main universe"

After that, I was able to install Tomcat 9 on Ubuntu 24.04 via apt.

Not sure if there could be any bad consequences after adding a legacy repository, though.

eraknix
June 23rd, 2024, 10:44 PM
Sorry wrong post... I don't know how to delete...

jha-santosh
October 13th, 2024, 11:50 AM
Thanks a lot! It helped in solving my problem.