我升级了GDAL
我的 ubuntu 18.04 服务器,并将GDAL 3.0.4
Postgres 从 12 降级到 11
完成 GDAL 升级后(gdal 安装按照以下链接完成在 Ubuntu 上安装 GDAL 软件包):
ogrinfo --version
Collecting GDAL==3.0.4
安装后其他 GDAL 包的状态:
- 库GDAL
dpkg -l | grep libgdal
libgdal-dev 3.0.4+dfsg-1~bionic0 amd64 libgdal26 3.0.4+dfsg-1~bionic0 amd64
ldconfig -p | grep gdal
libgdal.so.26 (libc6,x86-64) => /usr/lib/libgdal.so.26 libgdal.so (libc6,x86-64) => /usr/lib/libgdal.so
- 数据模型
dpkg -l | grep gdal-data
gdal-data 3.0.4+dfsg-1~bionic0 all
PostGIS
sudo apt install postgis postgresql-11-postgis-3
现在,当我尝试在新安装的设备上安装时PostgresSQL 11.8
出现以下错误:
The following packages have unmet dependencies: postgis : Depends: libgdal20 (>= 2.0.1) but it is not going to be installed Recommends: postgresql-12-postgis-3 but it is not going to be installed
然后我尝试:
sudo apt install libgdal20
libgdal20 : Depends: gdal-data (>= 2.4.2+dfsg-1~bionic0) but it is not going to be installed E: Unable to correct problems, you have held broken packages.
更新 我降级PostrgeSQL的步骤: 彻底删除 PostrgeSQL
sudo apt-get --purge autoremove postgresql*
sudo apt purge postgresql-client-common
dpkg -l | grep postgres
--> 删除其余的包:sudo apt-get --purge remove
<pkg_name>
请帮我修复错误,我被困在这里
答案1
另外,您也可以按如下方式从源代码进行编译:
wget https://download.osgeo.org/postgis/source/postgis-3.1.2.tar.gz
tar xf postgis-3.1.2.tar.gz
cd postgis-3.1.2
./configure
make && sudo make uninstall && sudo make install
我还没有针对 PostgreSQL 11 进行过测试,但如果我记得的话,它适用于 12 和 gdal 3。