Error running Software & Updates

xWarning: 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

I get this error when trying to load software and updates. Ubuntu MATE 24.04 but liklely it is same if happened on an non beta version. If you can make sense of this terminal output when I try to launch from terminal. Note that launching from GUI the icon appears in Plank but then disappears.

Any help will be appreciated.

1 Like

I'm using a Lubuntu noble session currently, and I'm getting something similar.

guiverc@d7050-next:/de2900/uwn$    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
guiverc@d7050-next:/de2900/uwn$

I suspect it's not a Ubuntu-MATE specific problem, and whilst I keep this machine updated, I've not rebooted in three days. If I try and run it from menu, nothing appears (I'm not using plank to see it)

I'm not sure what you mean here, I'm using an installed alpha or development release system, upgraded October 2023 at the beginning of the noble cycle.

I've not tried opening it another desktop (eg. GNOME with Wayland) but I'm about to head out now & pretty sure I'd get the same response there. No help, except somewhat like confirmation maybe.

1 Like

I also've had the hiccup with update-manager (on all 3 testmachines) where it disappeared the moment I selected "partial upgrade"

Considering the update, I've been a little late to the party I guess, a lot can change in 12 hours :smile:
So my old laptops spew some different errors. Two of the machines complained about missing directories and the third one complained about invalid escape sequences
after this sequence of commands:

sudo apt-get update
sudo apt-get autoremove
sudo apt-get dist-upgrade
sudo reboot

update-manager was back to normal again.

3 Likes

Thanks for your help! I did as you did, yet the Software & Updates, still closes as soon as it tries to launch. About 1 1/2 weeks ago I did indeed do a partial upgrade. I hate those as there is no real choice you have to do them and more often than not it borks some things in the system. Is there any clue in the screenshot I posted that may be fixed by some other method?

Thanks again for your help. Its good to know there are folks out there willing to help. I love MATE!

1 Like

Thanks for your response!

1 Like

Yes. The first error suggests a small bug in the code.
Since there have been updates you might want to reinstall/replace update-manager. In my experience, completely removing a package and then installing again works often better than a reinstall option.
so I suggest to do this:

sudo apt-get purge software-properties-gtk
sudo apt-get clean
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install software-properties-gtk ubuntu-release-upgrader-gtk update-manager update-notifier

and see if that works out.

1 Like

no it still didn't fix my issue, thanks for helping. I guess I'll just wait until April, then I will quit testing 24.04 and start with 24.10... No point in reinstalling this late in the game, I will however report this as a bug and maybe launchpad will find a solution

Hi, @mickee!

I believe this is related to deb822 apt source format. You may have an invalid .source file somewhere in your /etc/apt/. You have to check your /etc/apt/ directory tree and validate your source files.

https://www.debian.org/doc/manuals/debian-reference/ch02#_debian_archive_basics

Upd: This has already been reported.

4 Likes