0

I just upgraded to Ubuntu 22.04 Jammy from 20.04. I try to install Qgis following the instructions (https://www.qgis.org/en/site/forusers/alldownloads.html). When I try to run sudo apt update I get the message: Malformed stanza 1 in source list /etc/apt/sources.list.d/qgis.sources (type) The list of sources could not be read.

This is the string I added deb http://it.archive.ubuntu.com/ubuntu/ jammy-updates universe deb-src http://it.archive.ubuntu.com/ubuntu/ focal-updates universe

Anyone knows where I make a mistake? Thanks in advance

graham
  • 10,436
  • 2
    For starters, if you're running 22.04 then you shouldn't have "focal" repositories (focal = 20.04). – ChanganAuto Aug 25 '22 at 09:33
  • I solved the problem, maybe in an unfair way. I erased the content of /etc/apt/sources.list.d/qgis.sources. Then I run sudo apt update & upgrade. Finally I got QGis though not the latest version. I could also open synaptics that was blocked before – CARLO CITTER Aug 25 '22 at 16:00

1 Answers1

0

I get the message: Malformed stanza 1 in source list /etc/apt/sources.list.d/qgis.sources (type) The list of sources could not be read.

Please Edit your question including output of cat /etc/apt/sources.list.d/qgis.sources to see what is the malformed stanza 1 error means.

I tried your source based on your link. it Works for me :

Types: deb deb-src
URIs: https://qgis.org/ubuntu-ltr
Suites: jammy
Architectures: amd64
Components: main
Signed-By: /etc/apt/keyrings/qgis-archive-keyring.gpg

For Alternative software repositories you can add qgis.list from Ubuntu GIS repository :

  • Stable :

    deb http://ppa.launchpad.net/ubuntugis/ppa/ubuntu jammy main 
    deb-src http://ppa.launchpad.net/ubuntugis/ppa/ubuntu jammy main
    
  • Unstable :

    deb http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu jammy main 
    deb-src http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu jammy main 
    

Try to check your Qgis package candidate, run :

apt-cache policy qgis
qgis:
  Installed: (none)
  Candidate: 1:3.26.2+36jammy
  Version table:
     1:3.26.2+36jammy 500
        500 https://qgis.org/ubuntu jammy/main amd64 Packages
     3.22.4+dfsg-3build1 500
        500 http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages

You can see above detail, you can get latest release of Qgis version 3.26.

Sad3ng
  • 443
  • deb cdrom:[Ubuntu 20.04.4 LTS Focal Fossa - Release amd64 (20220223)]/ focal main restricted

    deb http://it.archive.ubuntu.com/ubuntu/ jammy main restricted

    deb-src http://it.archive.ubuntu.com/ubuntu/ focal main restricted

    Major bug fix updates produced after the final release of the

    distribution.

    deb http://it.archive.ubuntu.com/ubuntu/ jammy-updates main restricted

    deb-src http://it.archive.ubuntu.com/ubuntu/ focal-updates main restricted

    is this the first stanza?

    – CARLO CITTER Aug 25 '22 at 15:27
  • @CARLOCITTER Please Edit your question including output of cat /etc/apt/sources.list.d/qgis.sources and also your source list form /etc/apt/sources.list. Don't use unreadable code on this comment section. – Sad3ng Aug 25 '22 at 16:03