Tony B
Tony B

Reputation: 949

yum install tomcat8 CentOS 6

I want to keep in the yum ecosystem so I can more easily catch updates, so wanted to install a later version of tomcat to my CentOS 6.9 machine. But of course CentOS 6.9 does not give you any tomcat beyond tomcat6 via yum:

sudo yum search tomcat
Loaded plugins: auto-update-debuginfo, fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror.jaleco.com
 * epel: reflector.westga.edu
 * epel-debuginfo: reflector.westga.edu
 * extras: mirror.jaleco.com
 * rpmforge: mirror.lstn.net
 * rpmfusion-free-updates: mirror.math.princeton.edu
 * rpmfusion-free-updates-debuginfo: mirror.math.princeton.edu
 * rpmfusion-nonfree-updates: mirror.math.princeton.edu
 * rpmfusion-nonfree-updates-debuginfo: mirror.math.princeton.edu
 * updates: ftp.osuosl.org
===================================================== N/S Matched: tomcat =====================================================
apache-tomcat-apis.noarch : Tomcat Servlet and JSP APIs
jakarta-commons-collections-tomcat5.noarch : Jakarta Commons Collection dependency for Tomcat5
jakarta-commons-dbcp-tomcat5.noarch : DBCP dependency for Tomcat5
jakarta-commons-pool-tomcat5.i686 : Pool dependency for Tomcat5
jglobus-ssl-proxies-tomcat.noarch : Globus Java - SSL and proxy certificate support for Tomcat
tomcat-admin-webapps.noarch : The host-manager and manager web applications for Apache Tomcat
tomcat-docs-webapp.noarch : The docs web application for Apache Tomcat
tomcat-javadoc.noarch : Javadoc generated documentation for Apache Tomcat
tomcat-jsp-2.2-api.noarch : Apache Tomcat JSP API implementation classes
tomcat-jsvc.noarch : Apache jsvc wrapper for Apache Tomcat as separate service
tomcat-lib.noarch : Libraries needed to run the Tomcat Web container
tomcat-native.i686 : Tomcat native library
tomcat-native-debuginfo.i686 : Debug information for package tomcat-native
tomcat-servlet-3.0-api.noarch : Apache Tomcat Servlet API implementation classes
tomcat-webapps.noarch : The ROOT and examples web applications for Apache Tomcat
tomcat6-admin-webapps.noarch : The host-manager and manager web applications for Apache Tomcat
tomcat6-debuginfo.i686 : Debug information for package tomcat6
tomcat6-docs-webapp.noarch : The docs web application for Apache Tomcat
tomcat6-javadoc.noarch : Javadoc generated documentation for Apache Tomcat
tomcat6-jsp-2.1-api.noarch : Apache Tomcat JSP API implementation classes
tomcat6-lib.noarch : Libraries needed to run the Tomcat Web container
tomcat6-log4j.noarch : Log4J support for Apache Tomcat
tomcat6-servlet-2.5-api.noarch : Apache Tomcat Servlet API implementation classes
tomcat6-webapps.noarch : The ROOT and examples web applications for Apache Tomcat
tomcatjss.noarch : JSSE implementation using JSS for Tomcat
tomcat.noarch : Apache Servlet/JSP Engine, RI for Servlet 3.0/JSP 2.2 API
tomcat-el-2.2-api.noarch : Expression Language v1.0 API
tomcat6.noarch : Apache Servlet/JSP Engine, RI for Servlet 2.5/JSP 2.1 API
tomcat6-el-2.1-api.noarch : Expression Language v1.0 API

So what is the safest way to let me install any version of tomcat I want using yum? Do I need to add another repository, per chance?

3/4/2019 update, based on advice from user3788685:

sudo yum-config-manager --enable epel-testing
Loaded plugins: auto-update-debuginfo, fastestmirror, refresh-packagekit
=============================================================================================== repo: epel-testing ===============================================================================================
[epel-testing]
bandwidth = 0
base_persistdir = /var/lib/yum/repos/i386/6
baseurl = 
cache = 0
cachedir = /var/cache/yum/i386/6/epel-testing
cost = 1000
enabled = 1
enablegroups = True
exclude = 
failovermethod = priority
ftp_disable_epsv = False
gpgcadir = /var/lib/yum/repos/i386/6/epel-testing/gpgcadir
gpgcakey = 
gpgcheck = True
gpgdir = /var/lib/yum/repos/i386/6/epel-testing/gpgdir
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
hdrdir = /var/cache/yum/i386/6/epel-testing/headers
http_caching = all
includepkgs = 
keepalive = True
mdpolicy = group:primary
mediaid = 
metadata_expire = 21600
metalink = 
mirrorlist = https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=i386
mirrorlist_expire = 86400
name = Extra Packages for Enterprise Linux 6 - Testing - i386
old_base_cache_dir = 
password = 
persistdir = /var/lib/yum/repos/i386/6/epel-testing
pkgdir = /var/cache/yum/i386/6/epel-testing/packages
proxy = False
proxy_dict = 
proxy_password = 
proxy_username = 
repo_gpgcheck = False
retries = 10
skip_if_unavailable = False
ssl_check_cert_permissions = True
sslcacert = 
sslclientcert = 
sslclientkey = 
sslverify = True
throttle = 0
timeout = 30.0
username = 


sudo yum search tomcat        
Loaded plugins: auto-update-debuginfo, fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
 * base: mirror.metrocast.net
 * epel: archive.linux.duke.edu
 * epel-debuginfo: archive.linux.duke.edu
 * epel-testing: archive.linux.duke.edu
 * epel-testing-debuginfo: archive.linux.duke.edu
 * extras: ftp.osuosl.org
 * rpmforge: mirror.lstn.net
 * rpmfusion-free-updates: mirror.math.princeton.edu
 * rpmfusion-free-updates-debuginfo: mirror.math.princeton.edu
 * rpmfusion-nonfree-updates: mirror.math.princeton.edu
 * rpmfusion-nonfree-updates-debuginfo: mirror.math.princeton.edu
 * updates: mirror.steadfastnet.com
============================================================================================== N/S Matched: tomcat ===============================================================================================
apache-tomcat-apis.noarch : Tomcat Servlet and JSP APIs
jakarta-commons-collections-tomcat5.noarch : Jakarta Commons Collection dependency for Tomcat5
jakarta-commons-dbcp-tomcat5.noarch : DBCP dependency for Tomcat5
jakarta-commons-pool-tomcat5.i686 : Pool dependency for Tomcat5
jglobus-ssl-proxies-tomcat.noarch : Globus Java - SSL and proxy certificate support for Tomcat
tomcat-admin-webapps.noarch : The host-manager and manager web applications for Apache Tomcat
tomcat-docs-webapp.noarch : The docs web application for Apache Tomcat
tomcat-javadoc.noarch : Javadoc generated documentation for Apache Tomcat
tomcat-jsp-2.2-api.noarch : Apache Tomcat JSP API implementation classes
tomcat-jsvc.noarch : Apache jsvc wrapper for Apache Tomcat as separate service
tomcat-lib.noarch : Libraries needed to run the Tomcat Web container
tomcat-native.i686 : Tomcat native library
tomcat-native-debuginfo.i686 : Debug information for package tomcat-native
tomcat-servlet-3.0-api.noarch : Apache Tomcat Servlet API implementation classes
tomcat-webapps.noarch : The ROOT and examples web applications for Apache Tomcat
tomcat6-admin-webapps.noarch : The host-manager and manager web applications for Apache Tomcat
tomcat6-debuginfo.i686 : Debug information for package tomcat6
tomcat6-docs-webapp.noarch : The docs web application for Apache Tomcat
tomcat6-javadoc.noarch : Javadoc generated documentation for Apache Tomcat
tomcat6-jsp-2.1-api.noarch : Apache Tomcat JSP API implementation classes
tomcat6-lib.noarch : Libraries needed to run the Tomcat Web container
tomcat6-log4j.noarch : Log4J support for Apache Tomcat
tomcat6-servlet-2.5-api.noarch : Apache Tomcat Servlet API implementation classes
tomcat6-webapps.noarch : The ROOT and examples web applications for Apache Tomcat
tomcatjss.noarch : JSSE implementation using JSS for Tomcat
tomcat.noarch : Apache Servlet/JSP Engine, RI for Servlet 3.0/JSP 2.2 API
tomcat-el-2.2-api.noarch : Expression Language v1.0 API
tomcat6.noarch : Apache Servlet/JSP Engine, RI for Servlet 2.5/JSP 2.1 API
tomcat6-el-2.1-api.noarch : Expression Language v1.0 API

  Name and summary matches only, use "search all" for everything.

more /etc/yum.repos.d/epel-testing.repo 
[epel-testing]
name=Extra Packages for Enterprise Linux 6 - Testing - $basearch
#baseurl=http://download.fedoraproject.org/pub/epel/testing/6/$basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-testing-debuginfo]
name=Extra Packages for Enterprise Linux 6 - Testing - $basearch - Debug
#baseurl=http://download.fedoraproject.org/pub/epel/testing/6/$basearch/debug
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-debug-epel6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

[epel-testing-source]
name=Extra Packages for Enterprise Linux 6 - Testing - $basearch - Source
#baseurl=http://download.fedoraproject.org/pub/epel/testing/6/SRPMS
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-source-epel6&arch=$basearch
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6
gpgcheck=1

Upvotes: 1

Views: 1943

Answers (2)

user3788685
user3788685

Reputation: 3113

The epel-testing repo provides Tomcat-7.0.92.

$yum info tomcat
Installed Packages
Name        : tomcat
Arch        : noarch
Version     : 7.0.92
Release     : 1.el6
Size        : 314 k
Repo        : installed
From repo   : epel-testing
Summary     : Apache Servlet/JSP Engine, RI for Servlet 3.0/JSP 2.2 API
URL         : http://tomcat.apache.org/
License     : ASL 2.0

Check in /etc/yum.repos.d/epel.repo and see if you have the file, if you do check inside for/set enabled=1 and you should be able to install.

If you are missing the file the section you need is as follows;

[epel]
name=Extra Packages for Enterprise Linux 6 - $basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=epel-6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

[epel-testing]
name=Extra Packages for Enterprise Linux 6 - Testing - $basearch
mirrorlist=https://mirrors.fedoraproject.org/metalink?repo=testing-epel6&arch=$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-6

from there you can do yum update as normal for any new versions.

Upvotes: 1

Hichem BOUSSETTA
Hichem BOUSSETTA

Reputation: 1857

for me the recommended and safest way is to install the version you want manually. We had to deal with the same thing in production (rhel6 and rhel7) and we made the decision to download official tomcat version and to package it as rpm with all the necessary (tomcat user and group creation and systemd init script) you do this once and that's all. I can send you a example rpm build script and spec file.

Upvotes: 0

Related Questions