• Re: How to get apt to "see" hand-downloaded packages in archive cache?

    From Greg Wooledge@3:633/10 to All on Tuesday, March 10, 2026 12:30:01
    On Mon, Mar 09, 2026 at 23:52:52 -0400, deference@null.net wrote:
    Hello,
    Recently, I went to dist-upgrade. I ended up damaging the system by
    accident and decided to just do a fresh install. I saved the packages I
    had downloaded for the upgrade and restored them into
    /var/cache/apt/archives

    How would I get apt to recognize that the packages are there? It doesn't
    seem to notice them nor does aptitude.

    The packages in that directory will be used if they exactly match the
    names and versions that apt wants to download.

    hobbit:~$ ls -l /var/cache/apt/archives/
    total 20
    -rw-r----- 1 root root 0 Feb 17 2024 lock
    drwx------ 2 _apt root 4096 Mar 10 07:21 partial/
    -rw-r--r-- 1 root root 13172 Aug 7 2019 sl_5.02-1+b1_amd64.deb
    hobbit:~$ sudo apt-get install sl jzip
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    The following packages were automatically installed and are no longer required: [...]
    Use 'sudo apt autoremove' to remove them.
    Suggested packages:
    zcode-game
    The following NEW packages will be installed:
    jzip sl
    0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
    Need to get 54.4 kB/67.6 kB of archives.
    [...]

    In this example, the sl package was already in the cache, so it didn't
    need to be downloaded again, hence the 54.4 kB/67.6 kB.

    If, however, a new version of sl had been uploaded since 5.02-1+b1
    then the version in the cache would have been ignored.

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