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

where are the actual ".deb" packages? all I see are "pkgcache.bin" and "srcpkgcache.bin" . . .



 Basically, I am trying to download all packages that are part of the
installation dependencies of a given one into a directory of my
choosing to then install packages on an unexposed machine.
 apt-rdepends nicely lists all dependencies ordered as a depth first
graph, but I am getting "pkgcache.bin" and "srcpkgcache.bin" files for
all package names.

I found a nice explanation of what seems to be all there is to be
known about apt (any other documentation you would recommend?):

https://www.juliensobczak.com/inspect/2021/05/15/linux-packages-under-the-hood.html

but I don't see an answer to my question. Where are or how do I get
the ".deb" package out of those binary files?

 _DEB_PKG="gimp"
 _ARCH=$(dpkg --print-architecture)
 _DT=$(date +%Y%m%d%H%M%S)
 _LOG="apt-rdepends_${_DT}_${_DEB_PKG}_${_ARCH}.log"
 echo "// __ \$_LOG: |${_LOG}|"
###
 time apt-rdepends "${_DEB_PKG}:${_ARCH}" | grep --extended-regexp
'^[a-zA-Z0-9]' | tac > "${_LOG}" 2>&1

 ls -l "${_LOG}"
 wc -l "${_LOG}"

 _DEB_PKG_2DL=$(head -n 1 "${_LOG}")
 echo "// __ \$_DEB_PKG_2DL: |${_DEB_PKG_2DL}|"
 _DL_DIR="$(pwd)/${_DT}/${_DEB_PKG_2DL}"
 mkdir --parents --verbose "${_DL_DIR}"
 apt --option APT::Architecture="${_ARCH}" --option
Dir::Cache="${_DL_DIR}" download  "${_DEB_PKG_2DL}"
 ls -l "${_DL_DIR}"
 file "${_DL_DIR}/"*.*


// __ $_LOG: |apt-rdepends_20230226170006_gimp_amd64.log|
-rw-r--r-- 1 user user 3254 Feb 26 17:00
apt-rdepends_20230226170006_gimp_amd64.log
270 apt-rdepends_20230226170006_gimp_amd64.log
// __ $_DEB_PKG_2DL: |xdg-utils|
mkdir: created directory '/home/user/20230226170006'
mkdir: created directory '/home/user/20230226170006/xdg-utils'
Get:1 http://deb.debian.org/debian bullseye/main amd64 xdg-utils all
1.1.3-4.1 [75.5 kB]
Fetched 75.5 kB in 1s (143 kB/s)
total 67616
-rw-r--r-- 1 user user 34678812 Feb 26 17:00 pkgcache.bin
-rw-r--r-- 1 user user 34555088 Feb 26 17:00 srcpkgcache.bin
/home/user/20230226170006/xdg-utils/pkgcache.bin:    APT cache data,
version 16.0, little-endian, 97918 packages, 87142 versions
/home/user/20230226170006/xdg-utils/srcpkgcache.bin: APT cache data,
version 16.0, little-endian, 97917 packages, 87141 versions


Reply to: