- Package:
- python-software-properties
- Source:
- software-properties
- Submitter:
- Colin Simmonds
- Date:
- 2023-04-19 07:36:07 UTC
- Severity:
- normal
I tried to add the Ubuntu Wine repository using the command line
suggested on
the Wine Wiki, but it failed:
$ sudo add-apt-repository ppa:ubuntu-wine/ppa
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 65, in <module>
if not sp.add_source_from_line(line):
File "/usr/lib/python2.6/dist-
packages/softwareproperties/SoftwareProperties.py", line 630, in
add_source_from_line
(deb_line, file) = expand_ppa_line(line.strip(), self.distro.codename)
File "/usr/lib/python2.6/dist-packages/softwareproperties/ppa.py",
line 47,
in expand_ppa_line
sourceslistd = apt_pkg.Config.find_dir("Dir::Etc::sourceparts")
AttributeError: 'module' object has no attribute 'Config'
If PPA repositories are not supported in base Debian, an appropriate error
message should be displayed. Otherwise I'd expect that the new repository is
added to sources.list or the sources.list.d directory.
I also use the PPA for Wine in Wheezy. When I added the PPA, I did it
manually, but I was curious to see if it could be automated.
In /usr/lib/python2.6/dist-packages/softwareproperties/ppa.py
change:
sourceslistd = apt_pkg.Config.find_dir("Dir::Etc::sourceparts")
to this:
sourceslistd = apt_pkg.config.find_dir("Dir::Etc::sourceparts")
(Config should be lowercase)
Now, when you run apt-add-repository ppa:ubuntu-wine/ppa, it properly
adds the signing key, and creates a new file called
/etc/apt/sources.list.d/ubuntu-wine-ppa-wheezy.list, the contents of
which are:
deb http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu wheezy main
deb-src http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu wheezy main
It should be obvious that there aren't any "wheezy" releases on
Launchpad, so you'll have to change that to something more appropriate,
such as lucid for Squeeze systems, or maverick or natty for Wheezy or
Sid systems.
Hope this helps!
-- Kevin