Error while installing QGIS on Ubuntu 20.04

Question:

I’m trying to install QGIS for ubuntu 20.04 with this guide https://freegistutorial.com/install-qgis-on-ubuntu-20-04-focal-fossa/

I managed step one and successfully installed and upgradedgnupg software-properties-common, but when trying out step 2 i get the following message:

gpg: key 46B5721DBBD2996A: public key "QGIS Archive Automatic Signing Key (2021) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
gpg: no ultimately trusted keys found

While it says that the key’s been processed and imported, when I try to confirm it with gpg --fingerprint (public key), i get:

gpg: error reading key: No public key

I went on https://debian.qgis.org/debian/ to confirm I’m getting the qgis.gpg.key file and replaced the 2020 from the tutorial with 2021 that is visible in the directory, but that didn’t help either, I’m still getting the same error and I don’t understand why

Any information will be wildly helpful

EDIT: I downloaded my QGIS installer from https://www.qgis.org/en/site/forusers/alldownloads.html, i got the "Long Term Release" and the file is named QGIS-OSGeo4W-3.28.4-3.msi

SOLVED (i think): I found a different tutorial (https://semiautomaticclassificationmanual-v5.readthedocs.io/en/latest/installation_ubuntu.html) and installed QGIS with sudo-apt-get. Now when i type qgis in my terminal, the program starts although it’s probably going to come back to bite me later.

Asked By: AmazonPython

||

Answers:

Rather than picking random tutorials you should use the actual QGis instructions,

sudo apt install gnupg software-properties-common
sudo mkdir -m755 -p /etc/apt/keyrings 
sudo wget -O /etc/apt/keyrings/qgis-archive-keyring.gpg https://download.qgis.org/downloads/qgis-archive-keyring.gpg

then add the following to /etc/apt/sources.list.d/qgis.sources

Types: deb deb-src
URIs: https://qgis.org/debian
Suites: your-distributions-codename
Architectures: amd64
Components: main
Signed-By: /etc/apt/keyrings/qgis-archive-keyring.gpg

Then run:

sudo apt update
sudo apt install qgis qgis-plugin-grass
Answered By: Ian Turton
Categories: questions Tags: , , ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.