4

I am trying to install the latest version of QGIS 3 from the official website, on my PC running Ubuntu 18.04.5 LTS.

So, I am applying the commands step-by-step:

Step 1.

taras@dellpc:~$ sudo apt install gnupg software-properties-common
[sudo] password for taras: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
gnupg is already the newest version (2.2.4-1ubuntu1.3).
software-properties-common is already the newest version (0.96.24.32.14).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Step 2.

taras@dellpc:~$ 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
gpg: WARNING: unsafe ownership on homedir '/home/taras/.gnupg'
gpg: key F7E06F06199EF2F2: 1 signature not checked due to a missing key
gpg: key F7E06F06199EF2F2: "QGIS Archive Automatic Signing Key (2020) <qgis-developer@lists.osgeo.org>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

Step 3.

taras@dellpc:~$ sudo chmod a+r /etc/apt/trusted.gpg.d/qgis-archive.gpg

Step 4.

taras@dellpc:~$ sudo add-apt-repository "deb https://qgis.org/debian `lsb_release -c -s` main"          
Hit:3 http://qgis.org/debian trusty InRelease                                  
Hit:4 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic InRelease                                         
Hit:7 https://qgis.org/debian bionic InRelease                                 

Step 5.

taras@dellpc:~$ sudo apt update
Hit:1 http://qgis.org/debian trusty InRelease                         
Hit:5 https://qgis.org/debian bionic InRelease                                                          
Hit:7 http://ppa.launchpad.net/ubuntugis/ppa/ubuntu bionic InRelease           

Step 6.

taras@dellpc:~$ sudo apt install qgis qgis-plugin-grass
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 qgis : Depends: libqgis-3d3.16.2 but it is not going to be installed
        Depends: libqgis-analysis3.16.2 but it is not going to be installed
        Depends: libqgis-app3.16.2 but it is not going to be installed
        Depends: libqgis-core3.16.2 but it is not going to be installed
        Depends: libqgis-gui3.16.2 but it is not going to be installed
        Depends: python3-qgis (= 1:3.16.2+28bionic) but it is not going to be installed
        Depends: qgis-providers (= 1:3.16.2+28bionic) but it is not going to be installed
 qgis-plugin-grass : Depends: qgis-provider-grass (= 1:3.16.2+28bionic) but it is not going to be installed
                     Depends: grass740
                     Depends: libqgis-app3.16.2 but it is not going to be installed
                     Depends: libqgis-core3.16.2 but it is not going to be installed
                     Depends: libqgis-gui3.16.2 but it is not going to be installed
                     Depends: libqgisgrass7-3.16.2 but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

I tried answer 1, answer 2, but none of them helped me.

Then I tried this explicit answer and I was able to install QGIS, but version 2 instead of 3...

qgis_2

So, the question is: What shall I do to be able to install the latest QGIS 3 on my PC? Maybe I need repeat only steps 1 and 2 from here and then go back to the official website and run all the commands again?

A result of dpkg --get-selections | grep hold is empty.

And a result of sudo apt update

taras@dellpc:~$ sudo apt update
[sudo] password for taras: 
Ign:1 http://qgis.org/debian raring InRelease
Err:2 http://qgis.org/debian raring Release                                    
  404  Not Found [IP: 2606:4700:3033::6818:7651 80]       
E: The repository 'http://qgis.org/debian raring Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
7
  • 1
    Step 2 seems fine, you have the key already. Steps 4 and 5 error because of a postgresql repo, not QGIS. – bugmenot123 Jan 10 at 17:42
  • 1
    Do you have pending installations? Does dpkg --get-selections | grep hold return anything? Did you do apt update? – bugmenot123 Jan 10 at 17:44
  • 1
    Make sure you only have one QGIS repo in your sources.list. In your first examples you also have debian trusty's, in the edit you also have ubuntu raring's! This will make a mess. Remove all you do not need. – bugmenot123 Jan 10 at 18:00
  • You may also need to use .... "deb [arch=amd64] https:..... in Step 4. – Kadir Şahbaz Jan 10 at 22:23
  • 1
    Why are you using Debian repos under Ubuntu ? Replace apt source for deb and deb-src with https://qgis.org/ubuntu bionic main as you said you use 18.04 ? – J. Monticolo Jan 13 at 11:03
3

So, after a bit of time and several tips I was able to install QGIS 3

Step 1. With executing several commands from the 1st way to install QGIS (preferred.) erase unnecessary QGIS related repositories

  1. First remove already added repositories which you tried to install QGIS:
  • Execute this in your terminal: sudo software-properties-gtk and go to Other Software tab.

  • Then Remove those repositories that you added using your mentioned tutorial. Find names similar to http://qgis.org/debian and ubuntugis-unstable. Close the window.

  • The execute this command in terminal to update your repository: sudo apt-get update

Step 2. Run commands from this answer to delete the QGIS 2. If there is a need to uninstall the GRASS GIS, check this thread.

sudo apt autoremove
sudo apt autoclean
sudo apt -f install
sudo apt autoremove qgis
sudo apt --purge remove qgis

Step 3. Then proceed with

sudo apt update

Step 4. Since the "software-properties-common" is already existes on my machine, I can skip this command sudo apt install gnupg software-properties-common and go directly to

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

and

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

Step 5. Then proceed with sudo nano /etc/apt/sources.list and add these paths at the bottom of the sources.list file, see image below

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

step_5

Press Ctrl + x and save it with y.

Step 6. Apply again

sudo apt update

Step 7. After apply the main command to install the QGIS 3

sudo apt install qgis qgis-plugin-grass

Step 8. And finally proceed with

sudo apt update

and get the working QGIS 3 version on your Ubuntu

step_8

qgis_3

P.S. Pay attention to which distro you are installing you QGIS for, it says also in a note

Although you see ‘Debian’ in some places, this also works for ‘Ubuntu’, as one is actually a symlink to the other on our server.


References:

3
  • Didn't you get any error. I always get ..... doesn't support architecture 'i386' error while installation. And I specify the platform with [ arch=amd64 ] in sources.list – Kadir Şahbaz Jan 15 at 20:46
  • @KadirŞahbaz, I did not get an error, but it was some luck. Are you also using Ubuntu? – Taras Jan 16 at 14:47
  • I frequently use Ubuntu for coding. – Kadir Şahbaz Jan 16 at 15:27

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.