当我试图安装postgis时:
sudo apt install postgresql-12-postgis-2.5
我遇到了一个错误:
The following packages have unmet dependencies:
postgresql-12-postgis-2.5 : Depends: libgdal20 (>= 2.0.1) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
然后,当我试图安装libgdal20时,会遇到更多的依赖问题。
The following packages have unmet dependencies:
libgdal20 : Depends: gdal-data (>= 2.2.3+dfsg-2) but it is not going to be installed
Depends: libhdf5-100 but it is not going to be installed
Depends: libnetcdf13 (>= 4.0.1) but it is not going to be installed
Depends: libogdi3.2 (>= 3.2.0) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
有人能引导我正确地安装postgis吗?
这是我的sudo apt update
的结果。后面是许多类似于这个Target .... is configured multiple times in /etc/apt/sources.list:53 and /etc/apt/sources.list
的警告行:
A7gt;sudo apt-get update
Hit:1 http://fr.archive.ubuntu.com/ubuntu focal InRelease
Hit:2 http://fr.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:3 http://fr.archive.ubuntu.com/ubuntu focal-backports InRelease
Hit:4 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu focal InRelease
Hit:5 http://archive.ubuntu.com/ubuntu bionic InRelease
Hit:6 http://apt.postgresql.org/pub/repos/apt bionic-pgdg InRelease
Hit:7 http://archive.ubuntu.com/ubuntu bionic-security InRelease
Hit:8 http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu focal InRelease
Hit:9 http://archive.ubuntu.com/ubuntu bionic-updates InRelease
Ign:10 http://apt.postgresql.org/pub/repos/apt bionioc-pgdg InRelease
Hit:11 http://apt.postgresql.org/pub/repos/apt trusty-pgdg InRelease
Err:12 http://apt.postgresql.org/pub/repos/apt bionioc-pgdg Release
404 Not Found [IP: 147.75.85.69 80]
Hit:13 https://packages.cloud.google.com/apt cloud-sdk InRelease
Hit:14 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Hit:15 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:16 http://us.archive.ubuntu.com/ubuntu bionic-security InRelease
Hit:17 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
Ign:18 https://artifacts.elastic.co/packages/5.x/apt stable InRelease
Hit:19 https://artifacts.elastic.co/packages/5.x/apt stable Release
Reading package lists... Done
E: The repository 'http://apt.postgresql.org/pub/repos/apt bionioc-pgdg Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
发布于 2020-05-12 02:10:46
首先,删除现有的存储库,然后从仿生库中删除,这就是导致问题发生的原因。假设它居住在/etc/apt/sources.list.d/pgdg.list
上。
sudo rm /etc/apt/sources.list.d/pgdg.list
现在为您的系统添加正确的存储库。
echo "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" | sudo tee /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt update
sudo apt install postgresql-12-postgis-2.5
发布于 2020-07-03 15:48:25
Lido的回答也帮助我在Ubuntu 18上安装了Postgis (使用PostgreSQL 10),但我不得不安装Debian存储库中的libjson-c4和libgcc-s1包。
https://askubuntu.com/questions/1238423
复制相似问题