On Thu, 29 Jan 2026, [email protected] wrote:
(I am completely new to Linux besides basic stuff with proot-distro
on Termux on Android):
Hello. That sounds fun and I hope you have a good time.
I simply want to take a text file I have made of specified Debian
packages I want for my local repository (one for AMD64, the other
for ARM64), and download those packages as well as their depends,
predepends recursively, and whatever other packages that would have
been installed with “apt install”.
“apt install --download only”
(I see a hyphen missing between "download" and "only")
will miss packages that are already installed right?
Correct, as long as the already-installed packages in question are the
most current available version. (Any that can be upgraded, I expect
WILL be included.)
Also, are you aware that
/var/cache/apt/archives/
most likely contains those already-installed packages?
Two more details:
DETAIL 1: I don't use "apt", don't know anything about it. I use
apt-get, apt-cache, (and occasionally apt-mark). So above I have
assumed we are talking about
# apt-get --download-only install whatever
which I would shorten to
# apt-get -d install whatever
and I would also add -V to improve legibility of the list of packages
to be installed. Hence:
# apt-get -Vd install whatever
DETAIL 2: The result of
# apt-get -Vd install whatever
will partly depend on your APT configuration. For example, I have
$ cat /etc/apt/apt.conf.d/80unimportant_depends
// Only install important dependencies.
APT {
Install-Recommends "false";
Install-Suggests "false";
};
which means if I want recommends installed, then I need to ask for
them explicitly on the command line, in one way or another.
So that leaves me with making a list using “apt-cache depends” or
the apt-rdepends package,
I had never heard of this package, apt-rdepends. Interesting.
but the apt-rdepends package doesn't show virtual packages,
apt-cache depends does but does not resolved the virtual package
with what apt install would've defaulted to resolving to.
Once a package has been installed, it seems to me that
$ apt-cache --installed depends whatever
does something quite close to what you are asking for.
(In case two installed packages satisfy some dependency, I expect the
result will include both.)
To trim away Suggests and Recommends, instead do
$ apt-cache --important --installed depends whatever
or (shorter)
$ apt-cache -i --installed depends whatever
Then, if I try to target a different architecture,
[Much rocket science omitted]
Hoo boy, you're flying above my pay grade here.
How on earth can I just simply download a list of packages and all
their base needed packages like how apt install would have while
ALSO including already installed packages in the downloading
process.
# apt-get -d install $whatever
will download the package $whatever, and any packages it depends on,
MINUS those already installed, and put them in
/var/cache/apt/archives
Also, unless you have removed them somehow, that same directory should
ALREADY contain the packages of any already-installed dependencies for
$whatever (and the package $whatever itself, if already installed).
I thank whoever can help me. I just want this ONE thing before I
truly start my Linux adventure.
Good luck with your project :D