Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

513
Views
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.

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

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.

over 4 years ago · Santiago Trujillo Report

0

It happened the same to me, after upgrading to Ubuntu 20.04.

Usually a postgresql major upgrade do not replace the previous version, because the dabatase has to be dumped and restored. The new version is installed alongside the old one, and at the new server is assigned a different port. Is up to the user to migrate the old database to the new version.

In my case, the upgrade, for some reason, removed the postgis-2.5 library in the previous postgresql version, leaving a broken postgis installation in the old database (and no installation in the new one, of course.)

It's easy to be confused and connect to the wrong server; at least, I was easly confused and so received the same error message even after having installed postgis for the new postgresql version. I discovered the problem checking pg_lsclusters and understanding which server was listening on which port.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!