'apt-get source' fails when any "deb-src" repository is unreachable

Bug #85590 reported by kko on 2007-02-16
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)

Bug Description

Binary package hint: apt


When any "deb-src" repository listed in '/etc/apt/sources.list' can't be reached, 'apt-get source' fails.

To reproduce (on Kubuntu Dapper, with 'build-essential' installed):
1) add the following (nonsensical by content, just useful to demonstrate) line to your 'sources.list': "deb-src http://archive.canonical.com/ubuntu dapper-commercial main", and save it
2) do 'LC_ALL=C apt-get source libxine-main1'

The command dies with the following response:
"Reading package lists... Done
Building dependency tree... Done
E: Could not open file /var/lib/apt/lists/archive.canonical.com_ubuntu_dists_dapper-commercial_main_source_Sources - open (2 No such file or directory)"

This is somewhat silly, because the repository in question has nothing to do with the package we are requesting, and the sources are available from the main repository.

Related branches

Michael Vogt (mvo) on 2007-03-13
Changed in apt:
importance: Undecided → Medium
status: Unconfirmed → Confirmed
Harrison Conlin (harrisony) wrote :

Problem still exits on Hardy

Robert Roth (evfool) wrote :

Still exists on Natty.

Torsten Spindler (tspindler) wrote :

It seems that an error is thrown when a file is not found when the sources.list file and directory is parsed. However, I have not found the place where this error happens. Currently I'm looking at apt-pkg/deb/debsrcrecords.

Torsten Spindler (tspindler) wrote :

The attached patch checks if the source file in the lists directory exists via the stat function. If it doesn't exist it fails silently by returning null, instead of throwing an error.

Torsten Spindler (tspindler) wrote :

The last patch only applies against Lucid's version of apt, this one against Natty.

Torsten Spindler (tspindler) wrote :

I've placed upgraded packages for Lucid and Natty in a PPA: https://launchpad.net/~tspindler/+archive/apt .

Changed in apt (Ubuntu):
status: Confirmed → In Progress
tags: added: patch
Michael Vogt (mvo) wrote :

Thanks Thorsten! Slightly modfied version is in my branch now.

Changed in apt (Ubuntu):
status: In Progress → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt -

apt ( natty; urgency=low

  [ Michael Vogt ]
  * apt-pkg/deb/debindexfile.cc:
    - ignore missing deb-src files in /var/lib/apt/lists, thanks
      to Thorsten Spindler (LP: #85590)
  * apt-pkg/contrib/fileutl.cc, apt-pkg/deb/dpkgpm.cc:
    - honor Dpkg::Chroot-Directory in the RunScripts*() methods
 -- Michael Vogt <email address hidden> Thu, 03 Mar 2011 17:39:30 +0100

Changed in apt (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers