I just had a really hard time getting apt to add the repository key to a fresh install of Debian 10.

After much trial and error, I discovered that the following steps work:

wget https://qgis.org/downloads/qgis-2017.gpg.key
sudo apt-key add qgis-2017.gpg.key

When I tried the commands listed on the install page, I got this error:

gpg: key 51F523511C7028C3: 1 signature not checked due to a missing key

Also, note that I only had success with the 2017 key; not the 2019 one.


Same issue. Did not get it working in 2019 key install instructions. Worked with the 2017 key but that key will expire soon: 2019-08-16. In my case an Ubuntu docker 18.10 install (see my Dockerfile beneath). Although I still have same key errors (as above) with 2017 key apt-get update works with 2019 version it does not. Seem to be related to 2019 public key not yet present. Kind regards, Remco

    FROM ubuntu:18.04

    RUN apt-get update 
    RUN apt-get install -y gnupg ca-certificates wget

    RUN echo 'deb     https://qgis.org/ubuntu bionic main' >> /etc/apt/sources.list
    RUN echo 'deb-src https://qgis.org/ubuntu bionic main' >> /etc/apt/sources.list

    # Not working
    # RUN wget -O - https://qgis.org/downloads/qgis-2019.gpg.key | gpg --import
    # RUN gpg --fingerprint 51F523511C7028C3
    # RUN gpg --export --armor 51F523511C7028C3 | apt-key add -
    # Error message InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY CAEB3DC3BDF7FB45

    # Working (for now)
    RUN wget -O - https://qgis.org/downloads/qgis-2017.gpg.key | gpg --import
    RUN gpg --fingerprint CAEB3DC3BDF7FB45
    RUN gpg --export --armor CAEB3DC3BDF7FB45 | apt-key add -

    RUN apt-get update 
    RUN apt-get install -y qgis python3-qgis qgis-plugin-grass
| improve this answer | |

For avoiding key error in Debian 10, complete sequence of commands (as superuser) is as follow:

wget -O - https://qgis.org/downloads/qgis-2017.gpg.key | gpg --import
gpg --fingerprint CAEB3DC3BDF7FB45
gpg --export --armor CAEB3DC3BDF7FB45 | sudo apt-key add -
apt-get update

I precisely discovered it in this reference: https://www.gis-blog.com/how-to-install-qgis-3-on-ubuntu/

It worked for me.

Editing Note 1: With an unsolved key error, QGIS 2.18 will be installed instead.

Editing Note 2: I ran again all commands and you can observe my successful result:

zeito@debian-pc:~$ sudo su
[sudo] password for zeito: 
root@debian-pc:/home/zeito# wget -O - https://qgis.org/downloads/qgis-2017.gpg.key | gpg --import
--2019-08-10 21:02:33--  https://qgis.org/downloads/qgis-2017.gpg.key
Resolving qgis.org (qgis.org)...,, 2606:4700:30::681b:8bdc, ...
Connecting to qgis.org (qgis.org)||:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1944 (1,9K) [application/pgp-keys]
Saving to: ‘STDOUT’

-                   100%[===================>]   1,90K  --.-KB/s    in 0s      

2019-08-10 21:02:35 (26,4 MB/s) - written to stdout [1944/1944]

gpg: key CAEB3DC3BDF7FB45: 1 signature not checked due to a missing key
gpg: key CAEB3DC3BDF7FB45: "QGIS Archive Automatic Signing Key (2017) <qgis-developer@lists.osgeo.org>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1
root@debian-pc:/home/zeito# gpg --fingerprint CAEB3DC3BDF7FB45
pub   rsa2048 2017-08-16 [SC] [expires: 2019-08-16]
      61E0 A086 749E 463E DE50  2255 CAEB 3DC3 BDF7 FB45
uid           [ unknown] QGIS Archive Automatic Signing Key (2017) <qgis-developer@lists.osgeo.org>
sub   rsa2048 2017-08-16 [E] [expires: 2019-08-16]

root@debian-pc:/home/zeito# gpg --export --armor CAEB3DC3BDF7FB45 | sudo apt-key add -
root@debian-pc:/home/zeito# apt-get update
Hit:1 http://deb.debian.org/debian buster InRelease
Get:2 http://security.debian.org/debian-security buster/updates InRelease [39,1 kB]
Get:3 http://deb.debian.org/debian buster-updates InRelease [46,8 kB]          
Get:4 http://security.debian.org/debian-security buster/updates/main Sources [27,3 kB]
Get:5 http://security.debian.org/debian-security buster/updates/main amd64 Packages [56,6 kB]
Hit:6 https://qgis.org/debian buster InRelease                           
Get:7 http://security.debian.org/debian-security buster/updates/main Translation-en [31,6 kB]
Fetched 201 kB in 8s (26,6 kB/s)                                               
Reading package lists... Done
| improve this answer | |
  • I’ll try that on a clean install and see if it works. Regardless, it appears that the instructions on the web site do not work on Debian 10. – Daniel Boyd Aug 11 '19 at 0:18
  • It worked for me yesterday on a clean install! – xunilk Aug 11 '19 at 1:01
  • Please, see my second 'Editing Note'. – xunilk Aug 11 '19 at 1:10

Because of plugin incompatibilities I had to downgrade QGIS from the recent stable version (3.8) to the ltr version (3.4) ... and faced the sames issues above as described with the 2017 key.

System: Ubuntu 18.04 bionic

There is a 2019 key available now! The method described on linuxhint works but you need to use the new key like this

sudo vim  /etc/apt/sources.list   
#Add to sources for Stable version (3.8)  
deb https://qgis.org/debian bionic main

#Add to sources for LTR version (3.4)  
deb https://qgis.org/debian-ltr bionic main

wget -O - https://qgis.org/downloads/qgis-2019.gpg.key | gpg --import
gpg --fingerprint 51F523511C7028C3
sudo gpg --export --armor 51F523511C7028C3 | apt-key add -

sudo apt-get update
sudo apt-get install qgis python-qgis
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.