PostgreSQL 12和PostGIS 3.0.1:错误:无法访问文件“$libdir/postgis-3”:在Linux上没有这样的文件或目录

fhity93d  于 11个月前  发布在  PostgreSQL
关注(0)|答案(3)|浏览(350)

我有Linux Mint 19.2,我安装了最新的PostgreSQL 12,使用:
sudo apt-get install postgresql
同样,我安装了最新的Postgis 3.0.1,使用:
sudo apt-get install postgis
我设置了postgres帐户和所有的东西,并想创建一个PostGIS的扩展。因此,我还必须安装postgresql-12-postgis-3-scripts,它将postgis.control添加到PostgreSQL安装中。
然后,我连接到我的postgres帐户,创建并初始化了一个test数据库,并尝试create extension postgis。答案是:
ERROR: could not access file "$libdir/postgis-3": No such file or directory
PostgreSQL和PostGIS都是新安装的。我的计算机上没有损坏的依赖项或旧的PostgreSQL片段.

lkaoscv7

lkaoscv71#

你差一点就成功了。试着像这样在PostgreSQL 12中安装postgis

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

字符串
在那之后,你就可以成功地运行

CREATE EXTENSION postgis;

bxgwgixi

bxgwgixi2#

在Arch Linux上,您需要安装postgis-old-upgradepostgresql-old-upgrade

cpjpxq1n

cpjpxq1n3#

  • 我尝试了@JimJones的答案,它以前对我有效,但当我再次得到这个错误时,我再次尝试相同的解决方案时一直得到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
  • 对我有用的是安装gnupg 2。
  • 步骤
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

相关问题