apt-add-repository shouldn't add deb-src line automatically

Bug #987264 reported by Victor Engmark
80
This bug affects 17 people
Affects Status Importance Assigned to Milestone
software-properties (Ubuntu)
Fix Released
Undecided
oleg

Bug Description

`sudo apt-add-repository 'deb http://switch.dl.sourceforge.net/project/jedit /'` adds the following lines to /etc/apt/sources.list:

deb http://switch.dl.sourceforge.net/project/jedit /
deb-src http://switch.dl.sourceforge.net/project/jedit /

However, there is no source in that repository, so subsequent `sudo apt-get update` commands fail. The user will have to remove the deb-src line manually. It is not at all obvious why this is added, why it is needed, which file is changed, or how to fix it. The least surprising thing would be to simply add only the `deb` line.

Possible solutions:
1. Only add what the user asks for (principle of least astonishment).
2. Same as 1, but *check* afterwards if there is a source repository, and add it if it's available.
3. Add a --source or similar option to add the deb-src line.

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: python-software-properties 0.81.13.3
ProcVersionSignature: Ubuntu 3.0.0-17.30-generic 3.0.22
Uname: Linux 3.0.0-17-generic x86_64
NonfreeKernelModules: nvidia wl
ApportVersion: 1.23-0ubuntu4
Architecture: amd64
Date: Mon Apr 23 14:04:35 2012
InstallationMedia: Ubuntu 10.10 "Maverick Meerkat" - Release amd64+mac (20101008)
PackageArchitecture: all
ProcEnviron:
 PATH=(custom, user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
 LC_PAPER=en_GB.UTF-8
SourcePackage: software-properties
UpgradeStatus: Upgraded to oneiric on 2012-02-24 (58 days ago)

Revision history for this message
Victor Engmark (victor-engmark) wrote :
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
Revision history for this message
jhansonxi (jhansonxi) wrote :

This also affects the Opera repository:

add-apt-repository "deb http://deb.opera.com/opera/ stable non-free"
...
apt-get update
...
W: Failed to fetch http://deb.opera.com/opera/dists/stable/Release Unable to find expected entry 'non-free/source/Sources' in Release file (Wrong sources.list entry or malformed file)
...
tail -n 2 /etc/apt/sources.list
deb http://deb.opera.com/opera/ stable non-free
deb-src http://deb.opera.com/opera/ stable non-free # <- WTF?

Revision history for this message
jhansonxi (jhansonxi) wrote :

I'm using LInux Mint 13 (based on Ubuntu 12.04) i386
python-software-properties v0.82.7.1

Revision history for this message
michaelcole (8-launchpad-michaelcole-com) wrote :

This isn't an uncommon use case, and happens with the Virtualbox repo's as well

Passing a --no-source option would be backwards compatible

The deb-src is added around line 699 in /usr/lib/python2.7/dist-packages/softwareproperties/SoftwareProperties.py

/usr/bin/apt-add-repository can pass through the parameter towards the end of the file.

I can roll this as a patch if you tell me where to submit it

Thanks!

Mike

Revision history for this message
Javier Candeira (javier-0) wrote :

This also affects the ServerDensity repo.

Michael, you can submit your `--no-source option` patch (which I agree is the best idea) via launchpad.

See "Add attachment" on the right for the link.

Revision history for this message
Sami Jaktholm (sjakthol) wrote :

I believe this bug has been already fixed in Raring. Currently the source entry is added to sources list but it's disabled by default (bug 621977).

Changed in software-properties (Ubuntu):
status: Confirmed → Fix Released
oleg (termoz20)
Changed in software-properties (Ubuntu):
assignee: nobody → oleg (termoz20)
Revision history for this message
v. (tishma) wrote :

Unfortunately, there is no fix for this in 12.04

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.