`apt-add-repository --remove` doesn't remove deb-src lines

Bug #680203 reported by Darik Horn
44
This bug affects 8 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

With the same <sourceline> argument, the `apt-add-repository` command is not entirely reversed by the `apt-add-repository -r` command.

For example:

  $ sudo apt-add-repository ppa:dajhorn/ppa
  $ cat /etc/apt/sources.list.d/dajhorn-ppa-maverick.list
  deb http://ppa.launchpad.net/dajhorn/ppa/ubuntu maverick main
  deb-src http://ppa.launchpad.net/dajhorn/ppa/ubuntu maverick main
  $ sudo apt-add-repository --remove ppa:dajhorn/ppa
  $ cat /etc/apt/sources.list.d/dajhorn-ppa-maverick.list
     deb-src http://ppa.launchpad.net/dajhorn/ppa/ubuntu maverick main

Notice that the deb-src line persists. The expected behavior is that all lines added by `apt-add-repository` are removed and/or the list file is entirely deleted.

Furthermore, `apt-add-repository --remove` doesn't handle an explicit deb-src line:

  $ apt-add-repository --remove 'deb-src http://ppa.launchpad.net/dajhorn/ppa/ubuntu maverick main'
  $ echo $?
  0
  $ cat dajhorn-ppa-maverick.list
  deb-src http://ppa.launchpad.net/dajhorn/ppa/ubuntu maverick main

The expected behavior is the deletion of the given deb-src line.

If the <sourceline> argument doesn't exist, then an error message is emitted, but the result code is incorrect:

  $ apt-add-repository --remove 'deb-src http://ppa.launchpad.net/dajhorn/ppa/bogus maverick main'
  Error: 'deb-src http://ppa.launchpad.net/dajhorn/ppa/bogus maverick main' doesn't exist in a sourcelist file
  $ echo $?
  0

$ apt-cache policy python-software-properties
python-software-properties:
  Installed: 0.76.7
  Candidate: 0.76.7
  Version table:
 *** 0.76.7 0
        500 http://us.archive.ubuntu.com/ubuntu/ maverick/main amd64 Packages
        100 /var/lib/dpkg/status
$ lsb_release -rd
Description: Ubuntu 10.10
Release: 10.10

Revision history for this message
Removed by request (stoni.ch-deactivatedaccount) wrote :

Same problem here. In addition to scenarios mentioned above, "deb-src" occasionally are edited by "add-apt-repository --remove" becoming invalid, beginning with "src". Regards, Dani

Revision history for this message
Gregory Margo (gmargo) wrote :

Same problem - Confirmed today on both 10.10 Maverick and 11.04 Natty.

Additional related bug: The --remove option is not documented in the add-apt-repository(1) man page.

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

Thank you for taking the time to report this bug and helping to make Ubuntu better. This particular bug has already been reported and is a duplicate of bug #838507, so it is being marked as such. Please look at the other bug report to see if there is any missing information that you can provide, or to see if there is a workaround for the bug. Additionally, any further discussion regarding the bug should occur in the other report. Feel free to continue to report any other bugs you may find.

Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in software-properties (Ubuntu):
status: New → Confirmed
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.