Skip to content
Advertisement

PostgreSQL ERROR: could not access file “$libdir/postgis-2.5”

I’ve got a database with postgis installed, but it doesn’t work anymore:

# SELECT PostGIS_full_version();
ERROR:  could not access file "$libdir/postgis-2.5": No such file or directory
CONTEXT:  SQL statement "SELECT public.postgis_lib_version()"
PL/pgSQL function postgis_full_version() line 26 at SQL statement

I found other answers which suggested running ALTER EXTENSION postgis UPDATE;, so I did, but it has no effect:

my_db=# ALTER EXTENSION postgis UPDATE;
NOTICE:  version "2.5.4" of extension "postgis" is already installed
ALTER EXTENSION
my_db=# 
my_db=# SELECT PostGIS_full_version();
ERROR:  could not access file "$libdir/postgis-2.5": No such file or directory
CONTEXT:  SQL statement "SELECT public.postgis_lib_version()"
PL/pgSQL function postgis_full_version() line 26 at SQL statement

Does anybody have any idea on how to solve this?

(I’m on Ubuntu 20.04 with Posrgresql version 12.3. and I recently upgraded from Ubuntu 19.10 to 20.04, which I *think is when this started to be a problem)

[EDIT]

I searched in apt, and found this package which I didn’t have installed yet: postgresql-12-postgis-2.5. So after installing that (sudo apt install postgresql-12-postgis-2.5) I restarted postgresql (sudo service postgresql restart) and tried again, but I still get the same error.

Advertisement

Answer

I wanted to post this as a comment but I don’t have enough reputation for that. I had a very similar problem and explained in detail how I solved if over here. I hope this also helps you.

User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement