> 文章列表 > Ubuntu20.04 安装QGIS

Ubuntu20.04 安装QGIS

Ubuntu20.04 安装QGIS

qgisgit GitHub - qgis/QGIS: QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)

qgis的官网:Welcome to the QGIS project!

qgis插件包下载地址:https://plugins.qgis.org/plugins/

1.Prerequisites

  • Python 3.6+

  • QGIS 3

  • CARLA AD Map plugin version 2.4.5 and above

  • CARLA (Version >= 0.9.10)

  • CARLA Scenario Runner

2.QGIS 3.30

多数Linux发行版将QGIS分为几个软件包,您可能需要 qgis qgis python (用于运行插件)qgis grass (qgis-plugin-grass)qgis-server 等软件包最初安装时可以跳过,或者仅在需要时安装。

qgis网址:QGIS安装说明

1)首先安装为此指令所需的几个工具:

sudo apt install gnupg software-properties-common

2)现在安装QGIS签名密钥,以便信任并安装QGIS资源库中的软件:

sudo mkdir -m755 -p /etc/apt/keyrings  # not needed since apt version 2.4.0 like Debian 12 and Ubuntu 22 or newersudo wget -O /etc/apt/keyrings/qgis-archive-keyring.gpg https://download.qgis.org/downloads/qgis-archive-keyring.gpg

3)添加 QGIS repo QGIS:

sudo vim /etc/apt/sources.list.d/qgis.sources
Types: deb deb-src
URIs: https://qgis.org/ubuntu
Suites: focal
Architectures: amd64
Components: main
Signed-By: /etc/apt/keyrings/qgis-archive-keyring.gpg

Note

Suites查询命令 20.04是focal

lsb_release -cs 

支持的发行版:

分布

版本

开发代码名

基于UbuntuGIS稳定版依赖项是否可用?

Debian

11.x (stable)

bullseye

unstable

sid

Ubuntu

23.04

lunar 

22.10

kinetic

22.04 (LTS)

jammy

20.04 (LTS)

focal 

软件包说明:

最新版功能比较全,长期稳定版比较稳定,依照个人需求设置。

发行版

版本

描述说明

资源库

最新发行版

3.30.x 's-Hertogenbosch​

Debian Ubuntu 版本

Index of /debianhttps://qgis.org/debian

Index of /ubuntuhttps://qgis.org/ubuntu

使用UbuntuGIS不稳定版依赖项发布

Index of /ubuntugishttps://qgis.org/ubuntugis

即将发布的Debian和Ubuntu的每日构建版

Index of /debian-nightly-releasehttps://qgis.org/debian-nightly-release Index of /ubuntu-nightly-releasehttps://qgis.org/ubuntu-nightly-release

即将发布的UbuntuGIS不稳定版依赖项的每日构建版 

Index of /ubuntugis-nightly-releasehttps://qgis.org/ubuntugis-nightly-release

长期发行版资源库

3.28.x Firenze LTR

Debian Ubuntu 版本

Index of /debian-ltrhttps://qgis.org/debian-ltr Index of /ubuntu-ltrhttps://qgis.org/ubuntu-ltr

使用UbuntuGIS不稳定版依赖项发布

Index of /ubuntugis-ltrhttps://qgis.org/ubuntugis-ltr

即将发布的Debian和Ubuntu的每日构建版 5

Index of /debian-nightly-ltr Index of /ubuntu-nightly-ltrhttps://qgis.org/ubuntu-nightly-ltr

即将发布的UbuntuGIS不稳定版依赖项的每日构建版 5

Index of /ubuntugis-nightly-ltrhttps://qgis.org/ubuntugis-nightly-ltr

开发版

3.31 master

Debian Ubuntu 的每日构建版 5

Index of /debian-nightlyhttps://qgis.org/debian-nightly Index of /ubuntu-nightlyhttps://qgis.org/ubuntu-nightly

UbuntuGIS不稳定版依赖项的每日构建版 5

Index of /ubuntugis-nightlyhttps://qgis.org/ubuntugis-nightly

4)然后输入以下命令安装QGIS:

sudo apt update
sudo apt install qgis qgis-plugin-grass

如果要安装QGIS服务器,请输入:

sudo apt update
sudo apt install qgis-server --no-install-recommends --no-install-suggests
# if you want to install server Python plugins
sudo apt install python3-qgis

Note:

卸载qgis

sudo apt-get remove qgissudo apt-get purge qgis

遇到的问题:

1.

~$ sudo apt install qgis

下列软件包有未满足的依赖关系:

qgis : 依赖: python3-qgis (= 3.10.4+dfsg-1ubuntu2) 但是 1:3.26.3+32focal 正要被安装

依赖: qgis-providers (= 3.10.4+dfsg-1ubuntu2) 但是 1:3.26.3+32focal 正要被安装

推荐: qgis-plugin-grass 但是它将不会被安装

E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。

解决:

之前安装过qgis或者安装过这个依赖库版本不统一起了冲突

sudo apt remove python3-qgis

卸载后再次安装。

bug2:启动qgis时,弹出错误对话框,提示下面错误:

Traceback (most recent call last):File "Qt/xx.py", line 31, in <module>from PyQt5 import xx
ImportError: /lib/x86_64-linux-gnu/libQt5Core.so.5: version `Qt_5.15' not found 

解决:

pyqt5与qgis所要求的版本不对应,卸载pyqt5。

pip3 uninstall PyQt5sudo apt-get install python3-pyqt5