Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

525
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda