Comment 0 for bug 1632887

Revision history for this message
Haw Loeung (hloeung) wrote :

Hi,

At present, the apt fetch.add_sources() uses 'add-apt-repository' to add defined install_sources. Unfortunately, for private PPAs, this causes issues with multiple sources added to /etc/apt/sources.list (especially on change of key):

...
| # deb http://archive.canonical.com/ubuntu xenial partner
| # deb-src http://archive.canonical.com/ubuntu xenial partner
| deb https://prodstack-cdo:<email address hidden>/canonical-XXX-service/canonical-XXX-health/ubuntu xenial main
| # deb-src https://prodstack-cdo:<email address hidden>/canonical-is-sa/XXX-health/ubuntu xenial main
| deb https://prodstack-cdo:<email address hidden>/canonical-is-sa/XXX-health/ubuntu xenial main
| # deb-src https://prodstack-cdo:<email address hidden>/canonical-is-sa/XXX-health/ubuntu xenial main
| deb https://prodstack-cdo:<email address hidden>/canonical-XXX-service/canonical-XXX-health/ubuntu xenial main
| # deb-src https://prodstack-cdo:<email address hidden>/canonical-XXX-service/canonical-XXX-health/ubuntu xenial main
| # deb-src https://prodstack-cdo:<email address hidden>/canonical-XXX-service/canonical-XXX-health/ubuntu xenial main
| # deb-src https://prodstack-cdo:<email address hidden>/canonical-XXX-service/canonical-XXX-health/ubuntu xenial main
| # deb-src https://prodstack-cdo:<email address hidden>/canonical-XXX-service/canonical-XXX-health/ubuntu xenial main
| # deb-src https://prodstack-cdo:<email address hidden>/canonical-XXX-service/canonical-XXX-health/ubuntu xenial main
| # deb-src https://prodstack-cdo:<email address hidden>/canonical-XXX-service/canonical-XXX-health/ubuntu xenial main

As per the add-apt-repository man page[1], it says if you use the repository string ppa:... it will add the source to /etc/apt/sources.d but unfortunately digging into the code, it doesn't support private PPAs:

software-properties-0.96.20.4/softwareproperties/ppa.py:

| class PPAShortcutHandler(object):
| def __init__(self, shortcut):
| super(PPAShortcutHandler, self).__init__()
| try:
| self.shortcut = mangle_ppa_shortcut(shortcut)
| except:
| raise ShortcutException(_("ERROR: '{shortcut}' is not a valid ppa format")
| .format(shortcut=shortcut))
| info = get_ppa_info(self.shortcut)
|
| if "private" in info and info["private"]:
| raise ShortcutException(
| _("Adding private PPAs is not supported currently"))
|
| self._info = info

Any chance we could update fetch.add_sources() to handle private PPAs properly and ship them out to /etc/apt/sources.d like we're already doing for cloud: and proposed:?
[1]http://manpages.ubuntu.com/manpages/trusty/en/man1/add-apt-repository.1.html#contenttoc3