Directories titled "Sources" cause apt-cdrom to fail

Bug #750694 reported by Mario Limonciello on 2011-04-04
This bug affects 1 person
Affects Status Importance Assigned to Milestone
apt (Ubuntu)
Julian Andres Klode

Bug Description

Binary package hint: apt

In a scenario that I'm installing, there is a directory that contains a subdirectory "Sources" on my installation media. I find that directory's presence causes the installation to fail at the stage that apt scans the cdrom.

Manually running apt-cdrom add provides the following error:
Read error - read (21: Is a directory).

Removing the directory causes that portion of the installation to succeed.

Attached in an strace log. The directory in question is /cdrom/PostVistaPE/Sources.

Mario Limonciello (superm1) wrote :
Torsten Spindler (tspindler) wrote :

Confirming this bog on Ubuntu 10.04 LTS:

$ sudo apt-cdrom add
Using CD-ROM mount point /media/apt/
Identifying.. [4e8258cfd5d73bbef22ecebcc2f9d3c0-2]
Scanning disc for index files..
Found 0 package indexes, 1 source indexes, 0 translation indexes and 0 signatures
Please provide a name for this Disc, such as 'Debian 5.0.3 Disk 1':
Name: 'florp'
This disc is called:
Copying package lists...E: Read error - read (21: Is a directory)

Changed in apt (Ubuntu):
status: New → Confirmed
Torsten Spindler (tspindler) wrote :

This statement in seems to return false:

SrcCopy.CopyPackages(CDROM,Name,SourceList, log)

Torsten Spindler (tspindler) wrote :

In it is checked if the file exists, GetFileName is defined in indexcopy.h and returns "Sources" for SrcCopy:

      if (FileExists(*I + GetFileName()) == true)
  Pkg.Open(*I + GetFileName(),FileFd::ReadOnly);
  FileSize = Pkg.Size();

Changed in apt (Ubuntu):
status: Confirmed → Triaged
Julian Andres Klode (juliank) wrote :

This has been fixed in apt's debian-sid branch on Please note that this only works for directories and is generally not encouraged. Once we have done some final tests, we should be ready to upload a fixed version to Debian and Ubuntu.

apt ( UNRELEASED; urgency=low

  * apt-pkg/
    - Use RealFileExists() instead of FileExists(), allows amongst other
      things a directory named Sources to exist on a CD-ROM (LP: #750694).

Changed in apt (Ubuntu):
assignee: nobody → Julian Andres Klode (juliank)
status: Triaged → Fix Committed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package apt -

apt ( natty; urgency=low

  [ Michael Vogt ]
  * debian/apt.cron.daily:
    - run unattended-upgrades even if there was a error during
      the apt-get update (LP: #676295)

  [ Julian Andres Klode ]
  * apt-pkg/
    - Use RealFileExists() instead of FileExists(), allows amongst other
      things a directory named Sources to exist on a CD-ROM (LP: #750694).

  [ David Kalnischkies ]
  * apt-pkg/
    - use the native Architecture stored in the cache header instead of
      loading it from configuration as suggested by Julian Andres Klode
 -- Michael Vogt <email address hidden> Thu, 07 Apr 2011 12:52:21 +0200

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

Bug attachments