[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

how to make Packages file and set sources.list for misc. downloaded .deb files



I want to do something that should be simple, but apparently isn't.

I have a local collection of miscellaneous .deb files.  I want to be
able to use apt-get on then.

It is quite unclear how the various pieces of the system (the directory
name, the sources.list entry, the dpkg-scanpackages command arguments,
etc.) fit together.

(Besides being is out of sync with the software, the documentation (at
least in slink (apt version 0.3.10slink11) ) is missing some crucial 
information).  I can't figure out how various tools expect to be run.)


Can someone tell me exactly what I need to do to generates a Packages.gz
file and set up apt's source.list file to work with a local collection 
of miscellaneous Debian package files?


I want to know how to make this work in general, but here's the current
situation:

- I have used mirror to get KDE Debian package files from 
  ftp://ftp.varesearch.com/pub/mirrors/kde/stable/1.1.2/distribution/deb

- that FTP directory contains:
  slink/
  slink/i386/
  slink/i386/Packages.gz
  slink/i386/*.deb

- that pre-built Packages.gz file contains Filename entries like
  "Filename: /i386/qt1g-doc_1.44-6_all.deb".


- Mirroring that FTP directory to a similarly-named local directory 

  /usr/local/src/mirror/other/kde/mirror/stable/1.1.2/distribution/deb

  yielded a Packages.gz file at

  /usr/local/src/mirror/other/kde/mirror/stable/1.1.2/distribution/deb/slink/i386/Packages.gz

  and *.deb files in the same directory, such as

  /usr/local/src/mirror/other/kde/mirror/stable/1.1.2/distribution/deb/slink/i386/kdesupport0g-dev_1.1.2-19990906-1.0_i386.deb



Is it true that that directory hierarchy cannot be used by apt?

(It seems that apt always inserts "dists" when processing an entry
in sources.list.  However, man sources.list says absolutely nothing
about inserting "dists", and one example seemingly contradicts that:

   deb http://http.us.debian.org/debian dists/stable-updates

Also, it seems that apt always appends its own architecture suffix 
("binary-i386").)



So what exactly must I do to use apt?

It seems that I must structure my directories to include 
".../dists/.../binary-i386" in the pathname.  Is that correct?



To have "dists" and "binary-i386" in the directory pathname, I
copied my directory

  .../kde/mirror/stable/1.1.2/distribution/deb/slink/i386/

to 

  .../kde/mirror/stable/1.1.2/dists/binary-i386/


With a sources.list entry of 

  deb file:/root/mirror/other/kde/mirror/stable/1.1.2/ . .

that seemed to work with apt-get.




However, when I tried to install a package (with either "apt-get install 
xxx" or using dselect), I got this error:

  Err file:/root/mirror/other/kde/mirror/stable/1.1.2/ ./. kdebase-doc 4:1.1.2-19990906-1
    File not found
  Failed to fetch file:/root/mirror/other/kde/mirror/stable/1.1.2//i386/kdebase-doc_1.1.2-19990906-1_all.deb
    File not found


That makes some sense.  Evidently, apt uses file names from the Filename 
entries in the Packages.gz file, and they listed a directory of /i386,
(and didn't list dists/ or binary-i386).



So how do I name the directory so that apt can find the Packages.gz file
(e.g, containing "dists" and ending in "binary-386"), AND so that apt
can find the *.deb files (ending with i386)?

Is there some directory pathname that will work with that pre-built 
Packages.gz file, or is it screwed up to start with?



Well, never mind the pre-built Packages.gz file; I want to know how to
create it myself (for when I assemble a miscellaneous collection of *.deb
files).


Before generating a Packages.gz file I think I need to know what the
requirements are on the directory pathname.  

None of the documentation seems to address that.  Will any directory
pathname containing ".../dists/..." and ending in ".../binary-i386/"
be usuable, or are there further restrictions?


My copied directory seemed to work before, so I kept it, and deleted
the copied original packages file

  .../kde/mirror/stable/1.1.2/dists/binary-i386/Package.gz


I do know about dpkg-scanpackages.  (There's not anything else I
should be using, is there?)

Okay, so which directory do I want to specify to dpkg-scanpackages?

"man dpkg-scanpackages" says:

     binarydir is the name of the binary tree to  process  (for
       example,  contrib/binary-i386).   It  is best to make this
       relative to the root of the Debian archive, because  every
       Filename  field  in  the new Packages file will start with
       this string.

First of all, which directory do I want to specify?

Do I want to specify just the bottom directory 
.../kde/mirror/stable/1.1.2/dists/binary-i386 or might I want 
.../kde/mirror/stable/1.1.2/dists (or possibly 
.../kde/mirror/stable/1.1.2)?


Second, how exactly do I want to specify the directory?  

Specifically, which directory counts as the "root of the Debian 
archive"?  For a Debian directory like

           /root/mirror/debian/dists/slink/dists/stable/main/binary-i386/...

accessed by a sources.list entry of

  deb file:/root/mirror/debian/dists/slink       stable main 

which directory is the root the Debian archive?  Is it:
  /root/mirror/debian/dists/slink/dists/ or
  /root/mirror/debian/dists/slink/dists/stable/, or maybe
  /root/mirror/debian/dists/slink/dists/stable/main/, or possibly
  /root/mirror/debian/dists/slink/dists/stable/main/binary-i386?


Looking at the filename in the earlier error message
     (/root/mirror/other/kde/mirror/stable/1.1.2//i386/kdebase-doc_1.1.2-19990906-1_all.deb)
it looks like I need to get "dists/binary-i386" into the Filename
entries.

Apparently I can do that by running dpkg-scanpackages 
from .../kde/mirror/stable/1.1.2/ with "dists" or "dists/binary-i386".
Does it matter which?  

Picking one, from my directory .../kde/mirror/stable/1.1.2/ I execute
  dpkg-scanpackages dists /dev/null
and it seems to spit out data for Packages file.


Okay, so where exactly does the packages file need to be?  Does it go
at 
   .../kde/mirror/stable/1.1.2/dists/binary-i386/Packages.gz,
   .../kde/mirror/stable/1.1.2/dists/Packages.gz, or
   .../kde/mirror/stable/1.1.2/Packages.gz?


Trying
   .../kde/mirror/stable/1.1.2/Packages.gz
doesn't seem to work.

(With a sources.list entry of 
  deb file:/root/mirror/other/kde/mirror/stable/1.1.2/ . .
apt-get update says:
  Err file:/root/mirror/other/kde/mirror/stable/1.1.2/ ./. Packages
    File not found
  ...
)

Trying
   .../kde/mirror/stable/1.1.2/dists/Packages.gz
doesn't work either.


Okay, one choice left.  With the packages file at
   .../kde/mirror/stable/1.1.2/dists/binary-386/Packages.gz
"apt-get update" seems to work.



Now what happens with "apt-get install ..."?


AAGGGHHH!!! After all that, it still doesn't work.  Now it says:

  Package kdebase-doc has no available version, but exists in the database.
  This typically means that the package was mentioned in a dependency and 
  never uploaded, or that it is an obsolete package.
  E: Package kdebase-doc has no installation candidate

(What exactly is the problem?  )



So.... you might understand the frustration in my questions:


- HOW THE HELL DOES ONE USE APT-GET ON A LOCAL COLLECTION OF FILES?

- How exactly is the Packages.gz file supposed to be made?

- Did I need a real override file (instead of /dev/null)?

  - If so, why the hell isn't there a simpler way of making a Packages.gz
    file for a miscellaneous directory of .deb files?

- Do I need use some prefix (third argument) with dpkg-scanpackages?




Why isn't this stuff documented better?

- the sources.list manual page says nothing about inserting "dists", and 
  nothing about where the architecture-specific directory is inserted

- man sources.list says:
     _distribution_ can specify an exact path, in which case the 
     _components_ must be omitted and _distribution_ must end with 
     a slash (/). 
  but apt-get barfs if you try that

- none of the apt-get, dpkg-scanpackages, or sources.list manual pages,
  nor the /usr/doc/apt HTML documentation, seems to document much of
  anything about how to create a Packages file for a local pile of
  .deb files.



Can someone please help?


Thanks,
Daniel
-- 
Daniel Barclay
dsb@smart.net

 


Reply to: