66

I am relatively new to Linux, so can you indicate the exact commands (step-by-step) that I need to type to get the latest QGIS installed on Ubuntu 14.04.

I have tried to follow the instructions provided here https://www.qgis.org/en/site/forusers/alldownloads.html but I haven't managed to install anything.

Can someone explain to me step by step process of doing it. Right from adding the QGIS repository on the sources list.

I have Ubuntu 14.04.1 LTS installed on a 32-bit Dell Latitude E4310 Machine

PolyGeo
  • 65,136
  • 29
  • 109
  • 338
MARIO
  • 769
  • 1
  • 5
  • 5

3 Answers3

87

The instructions on the QGIS download site are not as intuitive as I'd like, but they do work when you know the command syntax:

First, what version of Debian Linux (Ubuntu / Mint) are you running?

The Ubuntu Codename of your APT repository will depend on the version of the OS and which version of QGIS you can run.

QGIS 3.10/14 will run on Ubuntu 20.04 (focal) and Linux Mint 20 (focal) and above.

You can run this command to get your DISTRIB_CODENAME:

cat /etc/upstream-release/lsb-release

Add links to QGIS repositories

# Replace 'codename' with your ubuntu version codename:

sudo add-apt-repository "deb https://qgis.org/debian codename main"

Add keys:

wget -qO - https://qgis.org/downloads/qgis-2020.gpg.key | sudo gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/qgis-archive.gpg --import

sudo chmod a+r /etc/apt/trusted.gpg.d/qgis-archive.gpg

Install QGIS

sudo apt-get update && sudo apt-get install qgis python-qgis  

Notes:

  • Keys last updated 08/12/2020
  • Please leave a comment if you notice they need updating again, and I will update this answer
  • The original QGIS instruction details are here
DPSSpatial_BoycottingGISSE
  • 18,790
  • 4
  • 66
  • 110
  • 2
    This worked for me, although I did replace the key 47765B75 with one that appeared when attempting the sudo apt-get update [..] the first time – Jur_ Mar 15 '16 at 09:06
  • Which might also be because I used http://qgis.org/ubuntugis. – Jur_ Mar 15 '16 at 09:15
  • @Jur_ good call, I need to make sure that is up to date... thanks!!! – DPSSpatial_BoycottingGISSE Mar 15 '16 at 15:29
  • could you add an explanation of the wget lines and beyond? The rest seems like more-or-less standard Ubuntu-ese, but that gets a bit abstruse. – MichaelChirico Jun 20 '16 at 16:08
  • @MichaelChirico wget is simply the terminal syntax to download a file... – DPSSpatial_BoycottingGISSE Dec 09 '16 at 22:41
  • Thanks a lot. I had to revert the packages back to trusty for my old Linux Mint laptop, but everything worked fine otherwise. – Eric Duminil May 10 '17 at 21:35
  • 1
    Still working June 2017 on Xenial. – swiss_knight Jun 18 '17 at 17:19
  • 1
    This is working on zesty, too now, Ubuntu 17.04 – BiggCrazy Jul 25 '17 at 07:38
  • Update on this: the key changes over the years, be sure to indicate to check the page http://www.qgis.org/en/site/forusers/alldownloads.html#debian-ubuntu for the most recent one. – Matifou Sep 09 '17 at 17:57
  • @Matifou thanks - been trying to keep an eye on that... will update on monday...! – DPSSpatial_BoycottingGISSE Sep 10 '17 at 00:56
  • Thanks.. worked on Lubuntu 16.04 (xenial), Oct 2017. The qgis.org page should mention to do the key stuff BEFORE the install commands, not after. – Nikhil VJ Oct 10 '17 at 01:51
  • @nikhilvj that's what the above commands do... – DPSSpatial_BoycottingGISSE Oct 10 '17 at 12:44
  • @DPSSpatial yep, thats why your answer worked for me while the official page didn't! – Nikhil VJ Oct 10 '17 at 14:40
  • @nikhilvj oh sorry I read your comment backwards - I've tried to reach out to the QGIS folks to put instructions similar to the ones above, but they didn't want to do it!!! – DPSSpatial_BoycottingGISSE Oct 10 '17 at 15:28
  • 1
    Best solution I've seen to installing QGIS from scratch, using this process above I safely installed the GRASS plugin as well. So, the final step can include sudo apt-get update && sudo apt-get install qgis python-qgis qgis-plugin-grass! – E. Weglarz Apr 26 '18 at 17:29
  • You might add that it's working for Linux Mint 18.x. Linux Mint 17.x will need trusty instead of xenial, and the upcoming 19.x will need bionic. For QGIS 3, you need ubuntugis on xenial, or artful or bionic with debian. – AndreJ May 03 '18 at 15:48
  • @AndreJ Thanks, I will add that. I will note the QGIS 3.0 limitations until the LTR is released, when I'm guessing the formal repositories will be available. – DPSSpatial_BoycottingGISSE May 03 '18 at 16:05
  • @DPSSpatial The limitation for xenial will stay even after the LTR, because the main ubuntu repo does not have GDAL 2 for xenial (and will never get it). – AndreJ May 03 '18 at 17:04
  • @AndreJ hmmm... I hesitate to ask 'why?'... is there a discussion about this somewhere? – DPSSpatial_BoycottingGISSE May 03 '18 at 17:07
  • I can't find a discussion, so you might start one on the mailing list. "Not enough manpower, but you can finance it" might be the answer you don't want to get. – AndreJ May 05 '18 at 17:22
  • @AndreJ perhaps it doesn't matter if the ubuntu-gis repository will be as easy to install from... – DPSSpatial_BoycottingGISSE May 05 '18 at 20:20
  • @AndreJ can you maybe clarify the repositories needed for QGIS 3 on ubuntu 16 / mint 18 and if it requires using the ubuntugis-unstable and any other limitations regarding GDAL - the previous discussion has likely been updated since May. And again, although a name is a name, the unstable repository is for development (is that correct?) and I think should be noted as such when pointing someone to using mixed software repositories / versions. – DPSSpatial_BoycottingGISSE Sep 13 '18 at 17:40
  • Since the topic is closed, I added an update to your answer. – AndreJ Sep 14 '18 at 14:51
  • I installed the QGIS 3.4.1 flatpak at https://flathub.org/apps/details/org.qgis.qgis following http://isticktoit.net/?p=2173 on my Ubuntu Xenial 16.04 system, and the 3D view seems to work! – weiji14 Nov 26 '18 at 00:58
  • wget returns a 403 now, you can use your browser to download the key or use curl: curl https://qgis.org/downloads/qgis-2019.gpg.key | gpg --import – Paul J Apr 22 '20 at 16:54
  • @PaulJ I ran it fine just now though it did take a bit longer than usual. – DPSSpatial_BoycottingGISSE Apr 22 '20 at 17:25
  • The instructions on the QGIS site now include a 2021 gpg key https://qgis.org/en/site/forusers/alldownloads.html#debian-ubuntu – Cowcross Dec 05 '21 at 19:47
  • Am unable to install on ubuntu 22.04, help me the way forward here – Francis Odero Nov 25 '22 at 21:53
37
  1. sudo add-apt-repository ppa:ubuntugis/ubuntugis-unstable
  2. sudo apt-get update
  3. If you already have qgis installed:
    sudo apt-get upgrade
    If you don't already have it:
    sudo apt-get install qgis
user1946657
  • 537
  • 3
  • 3
  • 2
    Could complete the install with : sudo apt-get install python-qgis qgis-plugin-grass – egoz Feb 04 '15 at 13:55
  • Note that this should install the newest version of QGIS. Probably OK for the OP, but not for me, who try to revert to 2.6 due tu a bug in newer versions. – Pavel V. Jul 09 '15 at 09:31
  • 4
    At least with 16.10 this is old advice. The version of qgis in the repository 2.14.5 is newer than the version in ubuntugis/ubuntugis-unstable, 2.14.1. And, 2.18 is out. – Evan Carroll Oct 26 '16 at 12:08
  • @EvanCarroll Could you provide what is the correct advice for those who want to install 2.18 or newer? – Alex Spurling Oct 26 '16 at 19:20
  • Give me one hour I'll be glad to on the road – Evan Carroll Oct 26 '16 at 19:22
  • @eqoz When I installed qgis from the instructions above and then added python-qgis qgis-plugin-grass, the installer said they were already the latest version. I had made a few unsuccessful installation attempts at that point, so maybe that had been installed somewhere along the way. – Patrick Williams Aug 24 '17 at 15:53
9

The Ubuntu and UbuntuGIS repositories really do lag very far behind the latest release of QGIS, so the best thing is to download directly from qgis.org.

Here is perhaps the simplest way to do this, assuming you already have Ubuntu Software Center:

  1. Open Ubuntu Software Center, go to Edit -> Software Sources -> Other Software -> Add, and then in the dialog for “APT line:”, add

    deb http://qgis.org/debian trusty main
    

    Then hit the ‘Add Source’ button to save, and close the dialog.

  2. Open your command line terminal (Ctrl + Alt + T), and then type

    sudo apt-get update && sudo apt-get install qgis python-qgis
    

    or if you want to install Grass as well,

    sudo apt-get update && sudo apt-get install qgis python-qgis qgis-plugin-grass
    
wittich
  • 2,356
  • 1
  • 16
  • 30
IanS
  • 1,373
  • 2
  • 16
  • 25
  • I get this when following these instructions : GPG error: http://qgis.org/debian xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 073D307A618E5811 W: The repository 'http://qgis.org/debian xenial InRelease' is not signed. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. – chrismarx Dec 12 '16 at 20:53
  • 1
    Following the answer from @DPSSpatial worked, for adding the key- – chrismarx Dec 12 '16 at 20:58