software-properties-gtk does not start

Bug #2053228 reported by corrado venturini
272
This bug affects 50 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Fix Released
Critical
Julian Andres Klode

Bug Description

On a new install with the new format sources.list software-properties-gtk does not start:
corrado@corrado-n4-nn-0215:~$ software-properties-gtk
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 100, in <module>
    app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 163, in __init__
    SoftwareProperties.__init__(self, options=options, datadir=datadir,
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
    self.backup_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 437, in backup_sourceslist
    source_bkp = SourceEntry(line=source.line,file=source.file)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 509, in __init__
    raise ValueError("Classic SourceEntry cannot be written to .sources file")
ValueError: Classic SourceEntry cannot be written to .sources file
corrado@corrado-n4-nn-0215:~$

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: software-properties-gtk 0.99.42
ProcVersionSignature: Ubuntu 6.6.0-14.14-generic 6.6.3
Uname: Linux 6.6.0-14-generic x86_64
ApportVersion: 2.27.0-0ubuntu6
Architecture: amd64
CasperMD5CheckResult: pass
CurrentDesktop: ubuntu:GNOME
Date: Thu Feb 15 10:07:43 2024
InstallationDate: Installed on 2024-02-15 (0 days ago)
InstallationMedia: Ubuntu 24.04 LTS "Noble Numbat" - Daily amd64 (20240215)
PackageArchitecture: all
ProcEnviron:
 LANG=en_US.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
SourcePackage: software-properties
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
corrado venturini (corradoventu) wrote :
Revision history for this message
madigal (osse7) wrote :

Get the same errors on Mate Noble, (new perl packages and dependencies previously upgraded; but might be of no concern here)

software-properties-gtk
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 100, in <module>
    app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 163, in __init__
    SoftwareProperties.__init__(self, options=options, datadir=datadir,
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
    self.backup_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 437, in backup_sourceslist
    source_bkp = SourceEntry(line=source.line,file=source.file)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 509, in __init__
    raise ValueError("Classic SourceEntry cannot be written to .sources file")
ValueError: Classic SourceEntry cannot be written to .sources file

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in software-properties (Ubuntu):
status: New → Confirmed
tags: added: rls-nn-incoming
Changed in software-properties (Ubuntu):
milestone: none → ubuntu-24.04-beta
importance: Undecided → Critical
Revision history for this message
Julian Andres Klode (juliank) wrote (last edit ):

I can confirm this on my system which is quite peculiar because I was testing the changes on it but it's possible I made additional changes after the changes that made software-properties work that broke it, or something.

I'll schedule to look at this the week after next.

Changed in software-properties (Ubuntu):
status: Confirmed → Triaged
tags: added: foundations-todo
removed: rls-nn-incoming
Changed in software-properties (Ubuntu):
assignee: nobody → Julian Andres Klode (juliank)
Revision history for this message
Helga (hkrobo) wrote (last edit ):

I have the same issue for software-properties-gtk. Software-properties-qt does start, but doesn't show any software sources as enabled.

If I had to guess, I'd blame the fact that upgrading to 24.04 seems to have moved default repos from /etc/apt/sources.list to /etc/apt/sources.list.d/ubuntu.sources and changed the format to the one specified in deb822. Attached here is my /etc/apt/sources.list.d/ubuntu.sources

upd: found this change that probably caused this bug: https://discourse.ubuntu.com/t/spec-apt-deb822-sources-by-default/29333

Revision history for this message
Claus7 (lastexile7gr) wrote :

The same happens if trying to open repositories under synaptic package manager, which allows the same configurations to take place.

Revision history for this message
GBate (bouki) wrote :

I have the same issue for software-properties-gtk.

Revision history for this message
cubells (cubells) wrote :

This comment solves bug for me:

https://bugs.launchpad.net/ubuntu/+source/python-apt/+bug/2053165/comments/3

I've deleted files and now software-properties-* works like a charm.

Revision history for this message
corrado venturini (corradoventu) wrote :

This is not a good idea, so your system will no longer be updated

Revision history for this message
Julian Andres Klode (juliank) wrote :

I must have forgotten to actually move this into the correct pulse to fix it, so it's in the 2 weeks starting the week after next now.

Revision history for this message
Yann (yourfrenchman) wrote :

Same happens after an upgrade from 22.10

Revision history for this message
Colin (colin-pyper) wrote :

I deleted the files in the /etc/apt/sources.list.d and then it opened normally except all the sources where unselected.
When software and properties is opened again just tick the appropriate sources from the first tab and select close and reload at the prompt. After that it has worked normally again.

Revision history for this message
corrado venturini (corradoventu) wrote :

I believe you now have sources.list in the old format

Revision history for this message
ajgreeny (ajg-charlbury) wrote :

Same problem on Mate and Xubuntu Noble.
Can not use synaptic in the usual manner to make changes to repositories so this needs fixing asap.

Revision history for this message
heny (heny67) wrote :

The PC is running ubuntumate 24.04. I reinstalled ubuntumate 22.04 on my laptop. I had the idea that I copied the sources.list.d folder from the laptop (22.04) to the PC (24.04). Since then, the error has not occurred.

Revision history for this message
Eduardo P. Gomez (eduapps) wrote (last edit ):

i got an additional error right here. Some syntax error:

====
==> root@eduapps:/home/eduardo# software-properties-gtk --open-tab=4
/usr/lib/python3/dist-packages/softwareproperties/gtk/DialogMirror.py:197: SyntaxWarning: invalid escape sequence '\.'
  elif re.match("^((ftp)|(http)|(file)|(rsync)|(https))://([a-z]|[A-Z]|[0-9]|:|/|\.|~)+$", uri) == None:
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 100, in <module>
    app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 163, in __init__
    SoftwareProperties.__init__(self, options=options, datadir=datadir,
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
    self.backup_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 437, in backup_sourceslist
    source_bkp = SourceEntry(line=source.line,file=source.file)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 509, in __init__
    raise ValueError("Classic SourceEntry cannot be written to .sources file")
ValueError: Classic SourceEntry cannot be written to .sources file
==> root@eduapps:/home/eduardo# software-properties-gtk
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 100, in <module>
    app = SoftwarePropertiesGtk(datadir=options.data_dir, options=options, file=file)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 163, in __init__
    SoftwareProperties.__init__(self, options=options, datadir=datadir,
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
    self.backup_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 437, in backup_sourceslist
    source_bkp = SourceEntry(line=source.line,file=source.file)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 509, in __init__
    raise ValueError("Classic SourceEntry cannot be written to .sources file")
ValueError: Classic SourceEntry cannot be written to .sources file
====
Original Ubuntu flavour, noble. Ran two times the same command.

Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :

A quick patch.

Revision history for this message
Julian Andres Klode (juliank) wrote :

While the patch makes the application run it also breaks the functionality it's patching for deb822 sources by just ignoring them. More work is needed and I do have it scheduled for this pulse

Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :

New patch that takes into account the _deb822 format.

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "patch.diff" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :

Anyway, the "Revert" button does nothing... so there is something else that has to be done.

Revision history for this message
Sergio Costas (rastersoft-gmail) wrote :

BTW: pressing the "Revert" button tries to launch "dbus-launch", but in my Noble system it wasn't installed. I had to manually install "dbus-x11" to have it. Maybe it should be included in the dependencies...

Revision history for this message
Yann (yourfrenchman) wrote :

Same for me on Ubuntu 24.04

File "/usr/lib/python3/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 163, in __init__
    SoftwareProperties.__init__(self, options=options, datadir=datadir,
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 109, in __init__
    self.backup_sourceslist()
  File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 437, in backup_sourceslist
    source_bkp = SourceEntry(line=source.line,file=source.file)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/aptsources/sourceslist.py", line 509, in __init__
    raise ValueError("Classic SourceEntry cannot be written to .sources file")
ValueError: Classic SourceEntry cannot be written to .sources file

Revision history for this message
Daniel van Vugt (vanvugt) wrote :
Revision history for this message
Zalán Hári (zalanhari) wrote :

I have the same error, but I was able to solve it by editing sourceslist.py and removing the .sources disablement.

PS: I reported the same bug a bit later, but when I changed its status, the bug report disappeared.

Changed in software-properties (Ubuntu):
status: Triaged → Fix Committed
Revision history for this message
Zalán Hári (zalanhari) wrote :

My original, duplicate report: https://bugs.launchpad.net/ubuntu/+source/update-manager/+bug/2055007

I thought that if I have a patch, I can change the status to „Fix Release”. Then I realized the problem, but I was unable to find that bug.

Revision history for this message
James Paton-Smith (jamesps) wrote :

Can confirm that the version in noble-proposed fixes this issue. Although I noticed another bug, possibly related to deb822 sources in general rather than this specific change: #2058715

Revision history for this message
corrado venturini (corradoventu) wrote (last edit ):

Also for me the version in noble-proposed fixes this issue.

Revision history for this message
Francois Thirioux (fthx) wrote :

I confirm this.
BUT:

with this ubuntu.sources:

Types: deb
URIs: http://archive.ubuntu.com/ubuntu
Suites: noble noble-updates noble-backports
Components: main universe restricted multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

Types: deb
URIs: http://security.ubuntu.com/ubuntu
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg

I get a line in 'Other softwares' tab in software-properties-gtk, containing noble noble-updates noble-backports suites. Is that ok?

Revision history for this message
Mike (kalel22) wrote (last edit ):

downgrading python3-276 to python3-271 helped! since then GTK is opening up again.

https://discourse.ubuntu.com/t/spec-apt-deb822-sources-by-default/29333

fthx
Feb 16
FYI I did revert to this one:
https://launchpad.net/ubuntu/+source/python-apt/2.7.1~ubuntu1/+build/27047450/+files/python3-apt_2.7.1~ubuntu1_amd64.deb 12
(I do use old sources format).

Revision history for this message
corrado venturini (corradoventu) wrote :

Using old format sources is a dirty trick, this bug affects Deb822 format sources.

Revision history for this message
corrado venturini (corradoventu) wrote :

Version from proposed works fine, thanks.
corrado@corrado-n7-nn-0306:~$ apt policy software-properties-gtk
software-properties-gtk:
  Installed: 0.99.44
  Candidate: 0.99.44
  Version table:
 *** 0.99.44 100
        100 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 Packages
        100 http://archive.ubuntu.com/ubuntu noble-proposed/main i386 Packages

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package software-properties - 0.99.44

---------------
software-properties (0.99.44) noble; urgency=medium

  * Handle backup and restore of deb822 sources (LP: #2053228)

software-properties (0.99.43) noble; urgency=medium

  * Fix autopkgtest: Make sure directory exists before trying to create file
    in it (LP: #2058035).

 -- Julian Andres Klode <email address hidden> Wed, 20 Mar 2024 13:18:16 +0100

Changed in software-properties (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Danilo Alculete (alculete) wrote :

For me it still not working, or it takes a while to be added to the updates?

Revision history for this message
corrado venturini (corradoventu) wrote :

Now software-properties-gtk does not crash but page 'Ubuntu software' is empty and page 'Other software' unclear. see screenshot

Revision history for this message
Roman (vient1) wrote :

For me app works fine now, don't see anything like @corradoventu does. I've run a full-upgrade though (don't do this, I've broken my system a bit, lol).

Revision history for this message
Shafn (shafn-2k24) wrote :

New here and to Linux. Seeing this after ignoring the python issue for a long time. I ignorantly upgraded to the dev branch of Ubuntu 24.04 from Ubuntu 22.04 LTS as a result of trying out do-release-upgrade blindly. (I didn't bother to look up the -d flag and what it does.)

I avoided the software-properties-gtk python issue by **deleting** the [u]older source files/entries[/u] from the /etc/apt/ folder as recommended by some above.

After Software & Updates started up again: out of all the repositories I did want to add, only AnyDesk's one worked. Not only did the rest not work but those caused the app to crash. I had to manually remove the new entries/files from the /etc/apt/ folder again in order to continue opening it directly.

Glad to see that it has some solution. There's a long way to go.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.