add-apt-repository adds invalid deb line if PPA contains a -

Bug #789859 reported by Rune K. Svendsen
218
This bug affects 39 people
Affects Status Importance Assigned to Milestone
software-properties (Debian)
Invalid
Undecided
Unassigned
software-properties (Ubuntu)
Fix Released
High
Unassigned
Precise
Won't Fix
Medium
Unassigned

Bug Description

STEPS TO REPRODUCE:

1. Add the PPA that contains a minus (-), with add-apt-repository:
sudo add-apt-repository ppa:deluge-team/ppa
2. Removing the PPA with ppa-purge:
sudo ppa-purge ppa:deluge-team/ppa
3. Again, add the PPA with add-apt-repository:
sudo add-apt-repository ppa:deluge-team/ppa

RESULT:
The file '/etc/apt/sources.list.d/deluge-team-ppa-natty.list' now contains an invalid third line that says 'ain':

rune@runescomp:~/Desktop$ cat /etc/apt/sources.list.d/deluge-team-ppa-natty.list
deb http://ppa.launchpad.net/deluge-team/ppa/ubuntu natty main
deb-src http://ppa.launchpad.net/deluge-team/ppa/ubuntu natty main
ain

ProblemType: Bug
DistroRelease: Ubuntu 11.04
Package: python-software-properties 0.80.9
ProcVersionSignature: Ubuntu 2.6.39-0.5~20110427-generic 2.6.39-rc5
Uname: Linux 2.6.39-0-generic x86_64
Architecture: amd64
Date: Sun May 29 14:20:37 2011
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64 (20101007)
PackageArchitecture: all
ProcEnviron:
 LANGUAGE=en_DK:en
 LANG=en_DK.UTF-8
 SHELL=/bin/bash
SourcePackage: software-properties
UpgradeStatus: Upgraded to natty on 2011-04-28 (30 days ago)

Revision history for this message
Rune K. Svendsen (runeks) wrote :
Revision history for this message
Rune K. Svendsen (runeks) wrote :

Note, this behavior is also described in Bug #640784, but this was allegedly fixed and the bug was closed.

Revision history for this message
Rune K. Svendsen (runeks) wrote :

It turns out we don't have to install anything, in order to reproduce this bug. Simply:

1. Adding the PPA with add-apt-repository
2. Removing the PPA with ppa-purge
3. Again, adding the PPA with add-apt-repository

reproduces this error.

I'm attaching a terminal log that shows how the third step above adds the invalid line "ain" to the .list file in question.

Also, I've noticed that this bug seemingly only appears when operating on PPAs which contain a forward slash in the title. Examples:
ppa:gnome3-team/gnome3
ppa:deluge-team/ppa
ppa:oibaf/graphics-drivers

So it seems add-apt-repository somewhere can't handle forward slashes.

summary: - add-apt-repository adds invalid deb line to sources file, if adding an
- already added, but disabled, PPA
+ if PPA contains a forward slash, when adding an already added, but
+ disabled PPA, add-apt-repository adds invalid deb line to sources file
description: updated
description: updated
Revision history for this message
Launchpad Janitor (janitor) wrote : Re: if PPA contains a forward slash, when adding an already added, but disabled PPA, add-apt-repository adds invalid deb line to sources file

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

Changed in software-properties (Ubuntu):
status: New → Confirmed
Revision history for this message
deuce (azinas) wrote :

Does removing the "ain" manually causes any problems?

Revision history for this message
Rune K. Svendsen (runeks) wrote :

No, not as far as I have experienced. The presence of the "ain" line is the only thing that is causing the issue, removing it fixes the issue.

Revision history for this message
YannUbuntu (yannubuntu) wrote :

Hello
I can reproduce this bug on Ubuntu 12.04. (and all supported previous Ubuntu versions).

I can add that this bug is NOT SYSTEMATIC, i mean on a given system if you use add-apt-repository then remove the ppa many times consecutively, sometimes the ppa is added correctly, sometimes not. But i can't manage to establish a rule saying why/when the bug appears.

IMHO, this bug is Importance=High , because it blocks the updates on the user's system.

Revision history for this message
YannUbuntu (yannubuntu) wrote :

Also, i saw several cases where the incorrect string was not "ain", but something-else.

eg:
- 'b-src' (http://ubuntuforums.org/showpost.php?p=11933526&postcount=380)
- 'n' ( https://answers.launchpad.net/os-uninstaller/+question/192165 , and another case reported to me by email with ppa:yannubuntu/os-uninstaller see attached screenshot )
- 'u' ( Bug #623389 )

Revision history for this message
YannUbuntu (yannubuntu) wrote :

Here is an example on 12.04 that shows this bug:

$ sudo -i
root@me:~# cat /etc/apt/sources.list.d/yannubuntu-boot-repair-precise.list
deb http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu precise main
root@me:~# add-apt-repository -y ppa:yannubuntu/boot-repair
(snip..)
root@me:~# cat /etc/apt/sources.list.d/yannubuntu-boot-repair-precise.list
deb-src http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu precise main
root@me:~# add-apt-repository -y ppa:yannubuntu/boot-repair
(..)
root@me:~# cat /etc/apt/sources.list.d/yannubuntu-boot-repair-precise.list
deb http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu precise main
ain
root@me:~# add-apt-repository -y ppa:yannubuntu/boot-repair
(..)
root@me:~# cat /etc/apt/sources.list.d/yannubuntu-boot-repair-precise.list
deb-src http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu precise main
root@me:~# add-apt-repository -y ppa:yannubuntu/boot-repair
(..)
root@me:~# cat /etc/apt/sources.list.d/yannubuntu-boot-repair-precise.list
deb http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu precise main
ain
root@me:~# add-apt-repository -y ppa:yannubuntu/boot-repair
(..)
root@me:~# cat /etc/apt/sources.list.d/yannubuntu-boot-repair-precise.list
deb-src http://ppa.launchpad.net/yannubuntu/boot-repair/ubuntu precise main

description: updated
Revision history for this message
V字龍(Vdragon) (vdragon) wrote :

I can comfirm yannubuntu's PPA will cause this problem in some propablility
(nicework for boot-repair :))

YannUbuntu (yannubuntu)
Changed in boot-repair:
status: New → Triaged
importance: Undecided → Medium
assignee: nobody → YannUbuntu (yannubuntu)
YannUbuntu (yannubuntu)
summary: - if PPA contains a forward slash, when adding an already added, but
- disabled PPA, add-apt-repository adds invalid deb line to sources file
+ add-apt-repository adds invalid deb line if PPA contains a / and a -
Revision history for this message
YannUbuntu (yannubuntu) wrote : Re: add-apt-repository adds invalid deb line if PPA contains a / and a -

Something we missed until now:
- we only tested PPAs. We should check if this bug occurs with "standard" repositories too.
- all tested reps contain a /, but also a minus (-). We should check if the bug also occurs if / but no - (or the contrary).
- we reproduced only with already added rep. We should check if this can happen with not yet added rep. (eg by using many times sudo rm /etc/apt/grub.d/deluge* , then sudo add-apt-repository ppa:deluge-team/ppa)

Changed in software-properties (Debian):
status: Unknown → New
YannUbuntu (yannubuntu)
Changed in boot-repair:
assignee: YannUbuntu (yannubuntu) → nobody
Revision history for this message
YannUbuntu (yannubuntu) wrote :

AFAIK, all PPAs, even those not affected by this bug, have a slash (/).
So this bug affects only PPAs with a dash (-) in its name.

Anybody working on this?

summary: - add-apt-repository adds invalid deb line if PPA contains a / and a -
+ add-apt-repository adds invalid deb line if PPA contains a -
description: updated
YannUbuntu (yannubuntu)
no longer affects: boot-repair
Revision history for this message
Brian Murray (brian-murray) wrote :

I've been unable to recreate this on Raring, Ubuntu 13.04. Is anyone else still having this issue?

Changed in software-properties (Ubuntu):
importance: Undecided → High
status: Confirmed → Incomplete
Revision history for this message
Rune K. Svendsen (runeks) wrote :

I can't reproduce this bug on Raring either, using either ppa:deluge-team/ppa or ppa:gnome3-team/gnome3.

Revision history for this message
Vadim Peretokin (vperetokin) wrote :

Per Debian report:

From: Jordan Metzmeier <email address hidden>
To: <email address hidden>
Subject: RE: add-apt-repository adds invalid deb line if the rep contains a -
Date: Tue, 11 Dec 2012 21:49:06 -0600
This bug appears to be filed against a version that does not exist in
debian. The current latest version in sid is 0.82.7.1. I was unable to
reproduce the bug using this version, so the problem may be specific
to Ubuntu.

Regards,
--
Jordan Metzmeier

Changed in software-properties (Debian):
importance: Unknown → Undecided
status: New → Invalid
Revision history for this message
Brian Murray (brian-murray) wrote :

I confirm that this bug report is fixed in Saucy.

Changed in software-properties (Ubuntu):
status: Incomplete → Fix Released
Changed in software-properties (Ubuntu Precise):
status: New → Triaged
importance: Undecided → Medium
Revision history for this message
sinjonjo (consultant-3) wrote :

Type 'ain' is not known on line 3 in source list /etc/apt/sources.list.d/yannubuntu-boot-repair-precise.list E: The list of sources could not be read. This is stopping apt-get update
terminal command does not accept this line: sudo ppa-purge ppa:deluge-team/ppa from steps below
please help

Revision history for this message
Nestor Fabellar (nfabellar) wrote :

E: Type 'wget' is not known on line 67 in source list /etc/apt/sources.list
E: The list of sources could not be read.

Revision history for this message
Steve Langasek (vorlon) wrote :

The Precise Pangolin has reached end of life, so this bug will not be fixed for that release

Changed in software-properties (Ubuntu Precise):
status: Triaged → Won't Fix
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.