首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在ubuntu20.04LTS上无法安装postgis

在ubuntu20.04LTS上无法安装postgis
EN

Ask Ubuntu用户
提问于 2020-05-11 22:16:59
回答 2查看 4K关注 0票数 3

当我试图安装postgis时:

代码语言:javascript
运行
复制
sudo apt install postgresql-12-postgis-2.5

我遇到了一个错误:

代码语言:javascript
运行
复制
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时,会遇到更多的依赖问题。

代码语言:javascript
运行
复制
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的警告行:

代码语言:javascript
运行
复制
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.
EN

回答 2

Ask Ubuntu用户

回答已采纳

发布于 2020-05-12 02:10:46

首先,删除现有的存储库,然后从仿生库中删除,这就是导致问题发生的原因。假设它居住在/etc/apt/sources.list.d/pgdg.list上。

代码语言:javascript
运行
复制
sudo rm /etc/apt/sources.list.d/pgdg.list

现在为您的系统添加正确的存储库。

代码语言:javascript
运行
复制
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
票数 3
EN

Ask Ubuntu用户

发布于 2020-07-03 15:48:25

Lido的回答也帮助我在Ubuntu 18上安装了Postgis (使用PostgreSQL 10),但我不得不安装Debian存储库中的libjson-c4和libgcc-s1包。

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1238423

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档