Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PostgreSQL 12 and PostGIS 3.0.1: ERROR: could not access file "$libdir/postgis-3": No such file or directory on Linux

I have Linux Mint 19.2 where I installed the newest PostgreSQL 12 using:

sudo apt-get install postgresql

Similarly, I installed the newest Postgis 3.0.1 using:

sudo apt-get install postgis

I setup postgres account and everything and wanted to create an extension of PostGIS. I thus had to install also postgresql-12-postgis-3-scripts, which added postgis.control into PostgreSQL installation.

I then connected to my postgres account, created and initialised a test database and attempted to create extension postgis. The answer was:

ERROR: could not access file "$libdir/postgis-3": No such file or directory

Both PostgreSQL and PostGIS were fresh installs. I have no broken dependencies or old PostgreSQL fragments on my computer... What am I missing? Thanks in advance.

like image 776
janchytry Avatar asked Jun 19 '20 09:06

janchytry


2 Answers

Welcome to SO.

You were close. Try installing postgis in your PostgreSQL 12 like this:

sudo apt-get install postgresql-12-postgis-3

After that you'll be able to successfully run

CREATE EXTENSION postgis;
like image 68
Jim Jones Avatar answered Oct 17 '22 12:10

Jim Jones


On Arch Linux you need to install postgis-old-upgrade alongside postgresql-old-upgrade.

like image 5
max taldykin Avatar answered Oct 17 '22 13:10

max taldykin