Tengo Linux Mint 19.2 donde instalé el PostgreSQL 12 más nuevo usando:
sudo apt-get install postgresql
De manera similar, instalé el Postgis 3.0.1 más nuevo usando:
sudo apt-get install postgis
Configuré la cuenta de postgres y todo y quería crear una extensión de PostGIS. Por lo tanto, tuve que instalar también postgresql-12-postgis-3-scripts , que agregó postgis.control a la instalación de PostgreSQL.
Luego me conecté a mi cuenta de postgres , creé e inicialicé una base de datos de test e intenté create extension postgis . La respuesta fue:
ERROR: could not access file "$libdir/postgis-3": No such file or directory
Tanto PostgreSQL como PostGIS eran instalaciones nuevas. No tengo dependencias rotas ni fragmentos antiguos de PostgreSQL en mi computadora... ¿Qué me estoy perdiendo? Gracias por adelantado.
Bienvenido a SO.
Estabas cerca. Intente instalar postgis en su PostgreSQL 12 de esta manera:
sudo apt-get install postgresql-12-postgis-3Después de eso, podrá ejecutar con éxito
CREATE EXTENSION postgis;En Arch Linux, debe instalar postgis-old-upgrade junto con postgresql-old-upgrade .
Probé la respuesta de @JimJones y funcionó para mí anteriormente, pero cuando recibí este error nuevamente, seguí recibiendo el Package postgresql-12-postgis-3 is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, or is only available from another source E: Package 'postgresql-12-postgis-3' has no installation candidate al volver a intentar la misma solución.
Lo que funcionó para mí fue instalar gnupg2.
sudo apt -y install gnupg2 wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" |sudo tee /etc/apt/sources.list.d/pgdg.list sudo apt update sudo apt install postgis postgresql-12-postgis-3