CentOS working with older repos

First, caveat: Centos6 is end of life so you should be upgrading to at least Centos7.

To install epel for a particular distro go to the epel website and that will tell you how to install epel for your particular distribution:

https://fedoraproject.org/wiki/EPEL#Quickstart

Do not try to mix different versions ie Centos7 / Centos8 as this will cause all sorts of dependency errors.

If you just want to find a particular package for a particular distribution there are two rpm search sites which can help locate older packages:

https://www.rpmfind.net/

and

http://rpm.pbone.net/


The fortune program in CentOS 7, is available under a different package name, fortune-mod, so (with EPEL repo enabled):

yum install fortune-mod

Why it was renamed to -mod is beyond me. But for some consistency of how you install it across different CentOS version, you can actually use binary name in lieu of package name:

yum install /usr/bin/fortune

In CentOS 8, it is not available.