• Specified Packages for a Local Repository

    From fireoflegend@3:633/10 to All on Thursday, January 29, 2026 19:40:01
    (I am completely new to Linux besides basic stuff with proot-distro on Termux on Android): 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? will miss packages that are already installed right? So that leaves me with making a list using ?apt-cache depends? or the apt-rdepends package , 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. Then, if I try to target a different architecture, first adding with dpkg --add-architecture command then apt update, I can list other packages, but apt-rdepends only lists the specified architecture for first set of dependencies and after tries to recurse with current native architecture packages; apt-cache depends will work if typing ?package:<arch>? but for some reason will include duplicates of certain packages where one will have the ending :<arch> and the other will not, and for the native architecture packages, now apt-cache depends will show both the unmarked native packages and some :<arch> marked packages of the foreign architecture along with it. Modifying sources.list for [ arch=<arch> ] fixes only when looking up native packages, but the foreign architecture packages still do that weird duplicate thing.
    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.
    I thank whoever can help me. I just want this ONE thing before I truly start my Linux adventure.


    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Dan Ritter@3:633/10 to All on Thursday, January 29, 2026 21:40:02
    fireoflegend@gmail.com wrote:

    [reformatting]

    (I am completely new to Linux besides basic stuff with proot-distro
    on Termux on Android): 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?.

    1. Why?


    2. On an AMD64 machine, run:
    sudo apt clean
    sudo apt -d install --reinstall package1 package2 ... packageN
    Now /var/cache/apt/archives holds all those packages and their
    dependencies.

    3. Repeat on an ARM64 machine.


    ?apt install
    --download only? will miss packages that are already installed
    right?

    You are confused. "apt install" won't install a package that is
    already installed, unless you specify --reinstall.

    apt install -d ... stops the install process after the packages
    are downloaded.

    to resolving to. Then, if I try to target a different architecture,
    first adding with dpkg --add-architecture command then apt update, I
    can list other packages

    To a first approximation, you never want to add an architecture.

    The various cases where you would:

    case: you are building a local mirror of multiple architectures.
    solution: use real mirroring software.

    case: you are switching from x86-32 to amd64
    solution: OK, this is where you would want to use
    --add-architecture, but a better solution is not to get int
    this mess in the first place.

    I thank whoever can help me. I just want this ONE thing before I truly start my Linux adventure.

    I repeat question 1: Why are you doing this? What do you want to
    accomplish?

    -dsr-

    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Greg Wooledge@3:633/10 to All on Thursday, January 29, 2026 22:00:01
    On Thu, Jan 29, 2026 at 15:18:55 -0500, Dan Ritter wrote:
    To a first approximation, you never want to add an architecture.

    The various cases where you would:

    case: you are building a local mirror of multiple architectures.
    solution: use real mirroring software.

    case: you are switching from x86-32 to amd64
    solution: OK, this is where you would want to use
    --add-architecture, but a better solution is not to get int
    this mess in the first place.

    The most *common* case, though, is that you're using an amd64 system
    and you need to run an i386 program on it. In that situation, you
    can add the i386 architecture and download the i386 shared library
    packages that your i386 program requires.

    This should become less common over time, as new i386 programs stop
    being produced. Or so we can hope.

    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Davidson@3:633/10 to All on Thursday, January 29, 2026 22:00:01
    On Thu, 29 Jan 2026, fireoflegend@gmail.com 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 \u201capt install\u201d.
    \u201capt install --download only\u201d
    (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 \u201capt-cache depends\u201d 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


    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Davidson@3:633/10 to All on Thursday, January 29, 2026 22:20:01
    Minor correction below:
    On Thu, 29 Jan 2026, Davidson wrote:
    On Thu, 29 Jan 2026, fireoflegend@gmail.com wrote:
    [snip]
    \u201capt install --download only\u201d
    [snip]
    will miss packages that are already installed right?
    [snip]
    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:
    ...to be DOWNLOADED. Not to be installed (because of option -d).
    # apt-get -Vd install whatever


    --- PyGate Linux v1.5.6
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)
  • From Tim Woodall@3:633/10 to All on Saturday, January 31, 2026 17:40:01
    On Thu, 29 Jan 2026, fireoflegend@gmail.com wrote:

    (I am completely new to Linux besides basic stuff with proot-distro on Termux on Android): 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? will miss packages that are already installed right? So that leaves me with making a list using ?apt-cache depends? or the apt-rdepends package , 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. Then, if I try to target a different architecture, first adding with dpkg --add-architecture command then apt update, I can list other packages, but apt-rdepends only lists the specified architecture for first set of depende!
    ncies and after tries to recurse with current native architecture packages; apt-cache depends will work if typing ?package:<arch>? but for some reason will include duplicates of certain packages where one will have the ending :<arch> and the other will not, and for the native architecture packages, now apt-cache depends will show both the unmarked native packages and some :<arch> marked packages of the foreign architecture along with it. Modifying sources.list for [ arch=<arch> ] fixes only when looking up native packages, but the foreign architecture packages still do that weird duplicate thing.

    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.

    I thank whoever can help me. I just want this ONE thing before I truly start my Linux adventure.

    I do this this way:

    APT_CONFIG=${APT_CONFIG} \
    DEBIAN_FRONTEND=noninteractive \
    apt-get -q -y --allow-unauthenticated install -d \
    -o APT::Install-Recommends=false \
    "$@"

    Where apt-config is setup like this:
    cat <<CATEOF >"${APT_CONFIG}"
    APT::Architecture "${ARCH}";
    APT::Install-Recommends "false";
    APT::Get::AllowUnauthenticated "${expired_key}"; Acquire::AllowInsecureRepositories "${expired_key}";
    Acquire::Check-Valid-Until "true";
    Acquire::http::Proxy "http://localhost:3128/";

    Dir::Etc::PreferencesParts "${APT_WORK}/preferences.d";
    Dir::Etc::SourceParts "${APT_WORK}/sources.list.d";
    Dir::Etc::TrustedParts "${aptdir}/trusted.d";
    Dir::Etc::Parts "${aptdir}/conf.d";

    Dir::State::Lists "${APT_WORK}/lists";
    Dir::State::Status "${APT_WORK}/status";
    Dir::Cache::Archives "${APT_WORK}/archives";
    Dir::Cache::srcpkgcache "${APT_WORK}/srcpkgcache";
    Dir::Cache::pkgcache "${APT_WORK}/pkgcache";
    CATEOF

    You'll need to create the directories, and populate a sources.list or
    two, but then apt will see a completely empty directory and download everything (except essential packages which aren't depended on).

    For the essential package I have a separate package that depends on them
    for exactly this purpose.

    This, along with a lot of extra stuff, can be found here: https://sourceforge.net/projects/dbootstrap/

    have a look at build-tarfiles.sh

    --- PyGate Linux v1.5.8
    * Origin: Dragon's Lair, PyGate NNTP<>Fido Gate (3:633/10)