0
sudo apt install qgis    

installs 2.8 (on 16.04) or 2.18 (on 18.04), but I would like to install version 3 (especially the 3.10 ltr) so I've tried:

sudo add-apt-repository https://qgis.org/ubuntu-ltr

which works as at the bottom of /etc/apt/sources.list there is:

deb https://qgis.org/ubuntu-ltr xenial main
# deb-src https://qgis.org/ubuntu-ltr xenial main

But this doesn't change what's installed - apparently that repository can't be used - I'm told by apt update:

Get:16 https://qgis.org/ubuntu-ltr buster InRelease [3,687 B]
rr:16 https://qgis.org/ubuntu-ltr buster InRelease                       
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51F523511C7028C3
Reading package lists... Done                        
W: GPG error: https://qgis.org/ubuntu-ltr buster InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 51F523511C7028C3
E: The repository 'https://qgis.org/ubuntu-ltr buster InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.

I'm also told:

N: See apt-secure(8) manpage for repository creation and user configuration details.

So apparently I need a key to securely acquire 3.10 from the ltr repository

Following the debian ubuntu instructions, I entered:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key
51F523511C7028C3

and while that stopped update complaints, I still can't install qgis because it complains about broken packages.


Set up a 16.04 image and did sudo apt update then upgrade then and autoremove.

Following the suggestion from Eric Gagné, I added the update command as well.

I tried 3 different of these

First

By just adding update:

$ sudo add-apt-repository https://qgis.org/ubuntu-ltr
$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 51F523511C7028C3
$ sudo apt update
$ sudo apt install qgis
$ qgis &

It runs but it's version 2.18.

Second

I added $ sudo apt upgrade after the update command.
It runs but it's also version 2.18.

Third

I changed to remove the ltr so as to try to get 3.12

$ sudo add-apt-repository https://qgis.org/ubuntu

I didn't use $ sudo apt upgrade this time. It runs but it's version 2.18.

So adding the extra update lets it run - but I don't get version 3???

  • 1
    You need to run apt-get update after adding the GPG key. And only then to actually install your software. explained here. If you still have error messages, please paste them by editing your post. – s.k May 1 at 14:28
  • What's the result of: sudo apt-cache policy qgis? Did you also properly removed QGIS 2.18? – s.k May 3 at 18:22
  • After receiving the suggestion I ran apt update after the key and it installed. That was on a new virtual machine. But earlier when it kept on installing 2.18, I had both removed it with a succession of apt-get remove, autoremove and autoremove --purge and started fresh with a new virtual machine - neither worked. – Henry Schaffer May 5 at 13:09
0

Did you run sudo apt update after adding the repository ?

For Ubuntu 18.04 try this.

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-key 51F523511C7028C3

In /etc/apt/sources make sure you have

deb https://qgis.org/ubuntu-ltr/ bionic main
deb-src https://qgis.org/ubuntu-ltr/ bionic main

Note the bionic for 18.04, not xenial and the deb-src line is not commented out.

sudo apt update
sudo apt install qgis python-qgis qgis-plugin-grass qgis-provider-grass qgis-providers qgis-server

That works on Linux Mint 19,3, should work just the same on Unbuntu 18.04

| improve this answer | |
  • Following the suggestion from @EricGagne I used 18.04, and $ sudo add-apt-repository qgis.org/ubuntu Then at the end of /etc/apt/sources it was bionic, but didn't have the -ltr and the deb-src line was commented out. But I ran sudo apt update, the sudo apt install qgis And then qgis ran and it was Version QGOS 3.12.2-Cucuresti I don't know what's going on - why I couldn't get 3.10 - but I can work with this! – Henry Schaffer May 3 at 19:01

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.