"software sources" UI broken in jaunty

Bug #319714 reported by Martin Olsson
32
This bug affects 5 people
Affects Status Importance Assigned to Milestone
python-apt (Ubuntu)
Fix Released
High
Unassigned
Nominated for Jaunty by Martin Olsson

Bug Description

If you select "System::Administration::Software Sources" currently _nothing_ happens on jaunty.

If I run it from a terminal, using the command:
gksu --desktop /usr/share/applications/software-properties.desktop /usr/bin/software-properties-gtk

Then I see this chain of nasty errors like this:
/usr/lib/python2.5/site-packages/apt/__init__.py:19: FutureWarning: apt API not stable yet warnings.warn("apt API not stable yet", FutureWarning)
reWarning: apt API not stable yetTraceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 101, in <module>
    app = SoftwarePropertiesGtk(datadir=data_dir, options=options, file=file)
  File "/usr/lib/python2.5/site-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 75, in __init__
    SoftwareProperties.__init__(self, options=options, datadir=datadir)
  File "/usr/lib/python2.5/site-packages/softwareproperties/SoftwareProperties.py", line 78, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python2.5/site-packages/softwareproperties/SoftwareProperties.py", line 516, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)
  File "/usr/lib/python2.5/site-packages/aptsources/distro.py", line 89, in get_sources
    raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/apport_python_hook.py", line 85, in apport_excepthook
    os.O_WRONLY|os.O_CREAT|os.O_EXCL), 'w')
OSError: [Errno 17] File exists: '/var/crash/_usr_bin_software-properties-gtk.0.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 101, in <module>
    app = SoftwarePropertiesGtk(datadir=data_dir, options=options, file=file)
  File "/usr/lib/python2.5/site-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 75, in __init__
    SoftwareProperties.__init__(self, options=options, datadir=datadir)
  File "/usr/lib/python2.5/site-packages/softwareproperties/SoftwareProperties.py", line 78, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python2.5/site-packages/softwareproperties/SoftwareProperties.py", line 516, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)
  File "/usr/lib/python2.5/site-packages/aptsources/distro.py", line 89, in get_sources
    raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template

Some guy on #ubuntu-bugs confirmed that it happens on his jaunty system as well.

Related branches

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, I can confirm this problem.

Changed in software-properties:
importance: Undecided → High
status: New → In Progress
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package python-apt - 0.7.9~exp2ubuntu2

---------------
python-apt (0.7.9~exp2ubuntu2) jaunty; urgency=low

  * apt/__init__.py:
    - remove the future warning
  * aptsources/distro.py:
    - fix indent breakage (LP: #319714)

 -- Michael Vogt <email address hidden> Wed, 21 Jan 2009 21:47:21 +0100

Changed in python-apt:
status: In Progress → Fix Released
Revision history for this message
Martin Olsson (mnemo) wrote :

I got the updated through synaptic now and installed it. "System::Administration::Software Sources" now works again, and when launching "gksu --desktop /usr/share/applications/software-properties.desktop /usr/bin/software-properties-gtk" from a terminal no errors at all is printed.

Confirming that this bug is indeed fixed.

Revision history for this message
Bryan Wu (cooloney) wrote :

Hi Michael,

I still got the similar issues on my latest X86_64 Jaunty:

-----
$ gksu --desktop /usr/share/applications/software-properties.desktop /usr/bin/software-properties-gtk
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 44, in <module>
    from softwareproperties.gtk.SoftwarePropertiesGtk import SoftwarePropertiesGtk
ImportError: No module named softwareproperties.gtk.SoftwarePropertiesGtk
Error in sys.excepthook:
Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/apport_python_hook.py", line 85, in apport_excepthook
    os.O_WRONLY|os.O_CREAT|os.O_EXCL), 'w')
OSError: [Errno 17] File exists: '/var/crash/_usr_bin_software-properties-gtk.0.crash'

Original exception was:
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 44, in <module>
    from softwareproperties.gtk.SoftwarePropertiesGtk import SoftwarePropertiesGtk
ImportError: No module named softwareproperties.gtk.SoftwarePropertiesGtk
$ sudo dpkg -l | grep python-apt
ii python-apt 0.7.9~exp2ubuntu8 Python interface to libapt-pkg
------

"Source Software" always crashes.

-Bryan

Revision history for this message
Martin Olsson (mnemo) wrote :

I used to have this problem but mvo's fix removed the bug for me (I also tried it again with latest jaunty bits just now and it's still gone). I do see some deprecation warnings printed to the console, but the GUI works without any problems.

Bryan, what does "dpkg -l | grep software-properties-gtk" print for you?

mnemo@kingfish:~$ gksu --desktop /usr/share/applications/software-properties.desktop /usr/bin/software-properties-gtk
/usr/bin/lsb_release:81: DeprecationWarning: the sets module is deprecated
  import sets
Warning: the md5 module is deprecated; use hashlib instead
/usr/bin/lsb_release:81: DeprecationWarning: the sets module is deprecated
  import sets
/usr/bin/lsb_release:81: DeprecationWarning: the sets module is deprecated
  import sets
/usr/bin/lsb_release:81: DeprecationWarning: the sets module is deprecated
  import sets
mnemo@kingfish:~$ dpkg -l | grep python-apt
ii python-apt 0.7.9~exp2ubuntu8 Python interface to libapt-pkg
mnemo@kingfish:~$ dpkg -l | grep software-properties-gtk
ii software-properties-gtk 0.71.1 manage the repositories that you install software from
mnemo@kingfish:~$

Revision history for this message
Bryan Wu (cooloney) wrote : Re: [Bug 319714] Re: "software sources" UI broken in jaunty
Download full text (4.8 KiB)

Hi Martin,

After I updated my Jaunty today, some software crashed before works fine now

---
$ dpkg -l | grep software-properties-gtk
ii software-properties-gtk 0.71.2
                manage the repositories that you install sof
$ dpkg -l | grep python-apt
ii python-apt 0.7.9~exp2ubuntu8
                Python interface to libapt-pkg
---

And command "$ gksu --desktop
/usr/share/applications/software-properties.desktop
/usr/bin/software-properties-gtk"
No such warning message as you posted at all on my side.

Thanks, I guess we can close this bug.
-Bryan

On Mon, Mar 2, 2009 at 10:30 PM, martin <email address hidden> wrote:
> I used to have this problem but mvo's fix removed the bug for me (I also
> tried it again with latest jaunty bits just now and it's still gone). I
> do see some deprecation warnings printed to the console, but the GUI
> works without any problems.
>
> Bryan, what does "dpkg -l | grep software-properties-gtk" print for you?
>
> mnemo@kingfish:~$ gksu --desktop /usr/share/applications/software-properties.desktop /usr/bin/software-properties-gtk
> /usr/bin/lsb_release:81: DeprecationWarning: the sets module is deprecated
>  import sets
> Warning: the md5 module is deprecated; use hashlib instead
> /usr/bin/lsb_release:81: DeprecationWarning: the sets module is deprecated
>  import sets
> /usr/bin/lsb_release:81: DeprecationWarning: the sets module is deprecated
>  import sets
> /usr/bin/lsb_release:81: DeprecationWarning: the sets module is deprecated
>  import sets
> mnemo@kingfish:~$ dpkg -l | grep python-apt
> ii  python-apt                                0.7.9~exp2ubuntu8                            Python interface to libapt-pkg
> mnemo@kingfish:~$ dpkg -l | grep software-properties-gtk
> ii  software-properties-gtk                   0.71.1                                       manage the repositories that you install software from
> mnemo@kingfish:~$
>
> --
> "software sources" UI broken in jaunty
> https://bugs.launchpad.net/bugs/319714
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in “python-apt” source package in Ubuntu: Fix Released
>
> Bug description:
> If you select "System::Administration::Software Sources" currently _nothing_ happens on jaunty.
>
> If I run it from a terminal, using the command:
> gksu --desktop /usr/share/applications/software-properties.desktop /usr/bin/software-properties-gtk
>
> Then I see this chain of nasty errors like this:
> /usr/lib/python2.5/site-packages/apt/__init__.py:19: FutureWarning: apt API not stable yet  warnings.warn("apt API not stable yet", FutureWarning)
> reWarning: apt API not stable yetTraceback (most recent call last):
>  File "/usr/bin/software-properties-gtk", line 101, in <module>
>    app = SoftwarePropertiesGtk(datadir=data_dir, options=options, file=file)
>  File "/usr/lib/python2.5/site-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 75, in __init__
>    SoftwareProperties.__init__(self, options=options, datadir=datadir)
>  File "/usr/lib/python2.5/site-packages/softwareproperties/SoftwareProperties.py", line 78, in __init__
>    self.reload_s...

Read more...

Revision history for this message
thanhbv (thanhbv) wrote :

I still got the issues on my latest X86 Jaunty:

---
# dpkg -l | grep software-properties-gtk
ii software-properties-gtk 0.71.5 manage the repositories that you install sof

# dpkg -l | grep python-apt
ii python-apt 0.7.9~exp2ubuntu10 Python interface to libapt-pkg

---
# gksu --desktop /usr/share/applications/software-properties.desktop /usr/bin/software-properties-gtk
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 104, in <module>
    app = SoftwarePropertiesGtk(datadir=data_dir, options=options, file=file)
  File "/usr/lib/python2.6/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 75, in __init__
    SoftwareProperties.__init__(self, options=options, datadir=datadir)
  File "/usr/lib/python2.6/dist-packages/softwareproperties/SoftwareProperties.py", line 83, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python2.6/dist-packages/softwareproperties/SoftwareProperties.py", line 521, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)
  File "/usr/lib/python2.6/dist-packages/aptsources/distro.py", line 90, in get_sources
    raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template

Revision history for this message
dcory (david-cory) wrote :

Are we sure this is solved?

I want to confirm that I'm having the same problem on a X86_64 jaunty. I'm using the RC, so I should have the benefit of the fix. [If someone things I have a different problem and I'm talking nonsense, feel free to tell me to stfu!]

---
gksu --desktop /usr/share/applications/software-properties.desktop /usr/bin/software-properties-gtk
Traceback (most recent call last): File "/usr/bin/software-properties-gtk", line 44, in <module>
    from softwareproperties.gtk.SoftwarePropertiesGtk import SoftwarePropertiesGtk
ImportError: No module named softwareproperties.gtk.SoftwarePropertiesGtk

Revision history for this message
Martin Olsson (mnemo) wrote :

I tried it again now with post-RC bits, it works perfectly on my machine. For me the bug is fixed.

I have these versions:
mnemo@kingfish:~$ dpkg -l | g software-properties
ii python-software-properties 0.71.5 manage the repositories that you install software from
ii software-properties-gtk 0.71.5 manage the repositories that you install software from
mnemo@kingfish:~$ dpkg -l | g python-apt
ii python-apt 0.7.9~exp2ubuntu10 Python interface to libapt-pkg

Revision history for this message
Jarkko Lietolahti (jarkko-jab) wrote :

9.10 / Karmic seems to have this same issue;

jarkko@gandalf:/etc/apt$ sudo synaptic
Traceback (most recent call last):
  File "/usr/bin/software-properties-gtk", line 104, in <module>
    app = SoftwarePropertiesGtk(datadir=data_dir, options=options, file=file)
  File "/usr/lib/python2.6/dist-packages/softwareproperties/gtk/SoftwarePropertiesGtk.py", line 75, in __init__
    SoftwareProperties.__init__(self, options=options, datadir=datadir)
  File "/usr/lib/python2.6/dist-packages/softwareproperties/SoftwareProperties.py", line 83, in __init__
    self.reload_sourceslist()
  File "/usr/lib/python2.6/dist-packages/softwareproperties/SoftwareProperties.py", line 521, in reload_sourceslist
    self.distro.get_sources(self.sourceslist)
  File "/usr/lib/python2.6/dist-packages/aptsources/distro.py", line 90, in get_sources
    raise NoDistroTemplateException("Error: could not find a "
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template
jarkko@gandalf:/etc/apt$ dpkg -l | grep software-properties-gtk
ii software-properties-gtk 0.71.5 manage the repositories that you install sof
jarkko@gandalf:/etc/apt$

Revision history for this message
Martin Olsson (mnemo) wrote :

@Jarkko, since this is a jaunty bug marked as "fixed released", let's instead track the issue you found using a new bug report:
https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/371228

At any rate, I can confirm karmic issue reported by Jarkko above.

Revision history for this message
Unhban (david-norris) wrote :

Sorry, as a newb I'm a bit confused about the comments.

Software Sources crashes. It is said that it has been fixed in python-apt - 0.7.9~exp2ubuntu2 . I have 0.7.9~exp2ubuntu10. So it should work? Or should I (somehow), using Synaptic, put on 0.7.9~exp2ubuntu2 ?

I'm using 9.04 and after running the program from a command line the error I get is 'no module named softwareproperties.gtk.SoftwarePropertiesGtk' .

Any advice is welcome as I have been trying to solve this crash for days now through using searches on Google.

Revision history for this message
Martin Olsson (mnemo) wrote :

To everyone who has the error "No module named softwareproperties.gtk.SoftwarePropertiesGtk". Please note that this bug report has nothing to do with that error! If you suffer from this error you should refer to this bug report instead: https://bugs.launchpad.net/ubuntu/+source/software-properties/+bug/361180

@Unhban, @Bryan Wu, @dcory... you can probably fix your issue by running these commands:

sudo apt-get install --reinstall python-apt update-manager-core update-manager python python-central synaptic gksu python-software-properties python-glade2 python-gtk2 software-properties-gtk
sudo apt-get update && sudo apt-get upgrade
sudo dpkg-reconfigure python-software-properties

Revision history for this message
Unhban (david-norris) wrote :

Yes, yes, yes! Many thanks Martin for taking the time and trouble to type that out - it worked pefectly. And I'm sure that by appending that info it will help many who have been brought to this page by Google :)

Just for others interest.... when I used the synaptic line it just opened Synaptic and seemed to do nothing, so I closed Synaptic and continued... and all worked out well.

Again Martin, so many thanks, a very valuable post.

Unh.

Revision history for this message
Robert Roth (evfool) wrote :

I am facing the same problem.... I have tried Martin's solution, I have replaced the sources.list file with the original one, I have checked the /usr/share/python-apt/templates/Ubuntu.info file, but I still get the same exception. I wanted to debug the distro.py, but I have no experience with python. Could anyone help me to find the cause of the problem?

Revision history for this message
Massimiliano Ballerini (mballerini) wrote :

Solved in my Jaunty with:

sudo apt-get install --reinstall python-software-properties

apt reinstalled same version, probably an previus update corruption.

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.