Trying to install postgis on Centos 6.9 and missing dependency libgeotiff.so.2

This got deleted from ServerFault as Centos 6 is not supported (at least by the original developers). That said, I DID figure out how to install Postgresql on Centos 6.9 - so I'm copying the deleted content for this blog post (running on Drupal 4 which is years past its security life and has not had any issues).

There are all sorts of reasons you might want to risk running old software and there are millions of organizations and people doing so. In my case, I didn't care too much if a hacker got access to my census data. Compared to the amount of work it takes to move 400 GB of tens of millions of tiny files... the risk was fairly acceptable. And I'm doing JusticeMap as a volunteer. Not everyone has a full-time tech budget...

Though I did decide to get a Debian 10 server and am now spending a lot of time moving everything on to that. It was admittedly a lot easier to install the default version of Postgresql (11) on Debian 10.

---------------

I'm trying to install Postgis 2.1 on Centos 6.9 (and postgresql 9.5). I try to yum install it:

yum install postgis21_95

And get the error:

> Finished Dependency Resolution
Error: Package: gdal-libs-1.9.2-8.rhel6.x86_64 (pgdg-common)
Requires: libgeotiff.so.2()(64bit)
You could try using --skip-broken to work around the problem
You could try running: rpm -Va --nofiles --nodigest

I have installed the package: "libgeotiff.x86_64 1.2.5-6.el6" but that doesn't seem to be the right one.

I have very little experience installing packages on linux. I did some web searches and didn't find an answer.

What can I do to get it to properly install?

Alternatively: 2. If I don't need the geotiff functionality of postgis, can I safely skip this using "--skip-broken"?
asked Sep 3 at 23:45
Aaron Kreider

CentOS 6 has passed end of life. Upgrade to a supported Linux distribution. –
Michael Hampton
Sep 4 at 11:29

Definitively! You really should not use CentOS 6 anymore. –
Lutz Willek

Sep 4 at 12:56
People say the same thing about Drupal 4. But it works great for my blog! So should I go with Centos 7? Moving the data is going to be a chore (500 GB - 1 TB of tiny files). It's a low end server with a lot of files. –
Aaron Kreider

Sep 4 at 20:51
1
I'll try to paraphrase gently: Drupal 4 was great software, just like CentOS 6 was a great operating system. However, it is simply no longer actualized, and thus inevitably security gaps are open. My professional opinion: Having such a system running on the internet is like playing Russian roulette with 6 bullets in the drum. My personal opinion: Of course, you are completely free to do so, but then you also have to live with the unpleasant consequences. (no offence) –
Lutz Willek

Sep 4 at 22:36
Ok. I'm also going to try if I can get postgis installed on a new Centos 7 server. –
Aaron Kreider

Sep 4 at 23:25
CentOS 7 already reached EOU on 2020-08-06 and will reach EOL on 2024-06-30. CentOS 8 will reach EOL on 2021-12-31. Assuming you don't want to upgrade too often, another Linux distribution which offers long term support (LTS) is probably the better option. At the moment, Debian 11 (Bullseye) would be a good choice, as EOS is 2026 and even ELTS is offered for Debian releases. –
Lutz Willek
Sep 5 at 8:01

ANSWER
Additional packages from ​EPEL 6 (Extra Packages for Enterprise Linux) are required to fulfill requirements for GDAL. (so enable epel)

However, instead solving this installation challenge on a CentOS 6 installation in 2021, you really should consider upgrading the operating system.

Life is strange sometimes: In case there is a reason why upgrading the OS is not a achievable option, change your repository sources to use the archived versions, as end of 2020 all sources have been removed from mirror servers to reflect the end of life (EOL) status of CentOS6.
answered Sep 4 at 13:02
Lutz Willek

I've got this epel package installed: epel-release-6-8.noarch I tried: yum --enablerepo="epel" install postgis21_95 and get the same error. When I do yum search epel-release it says "1594 packages excluded due to repository priority protections." Is that a problem? –
Aaron Kreider
Sep 4 at 22:04

Update the repository URL, as described and linked in answer. You are using CentOS 6.9, so use http://vault.centos.org/6.9/*. (As already written, installing epel-release-6-8 does not help as end of 2020 all sources have been removed from mirror servers to reflect the EOL status of CentOS6.) –
Lutz Willek
Sep 4 at 22:14

Ok, thanks! I followed the instructions in your link. Now I get: Package: gdal-libs-1.9.2-8.rhel6.x86_64 (pgdg-common) Requires: libnetcdf.so.6()(64bit) It seems like I might need netcdf 4.1.1 which has that file. So far I found 4.1.2 at rpmforge, but haven't found 4.1.1. –
Aaron Kreider
Sep 4 at 22:56

There are netcdf packages in the EPEL repository. The command yum list netcdf\* will show you the choices available. –
Lutz Willek
Sep 4 at 23:13

Ahh I think I needed to disable the rpmreforge.repo. So I did that and now the install worked!
Aaron Kreider