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

`apt install ./<deb>` chooses http over local file



Hi folks,

Imagine I want to install a local package.  I do : `apt install ./$deb`.
This works fine.  But if $deb also exists in apt's sources, and is the
same version, apt always chooses to download it.  I can reproduce in a
clean env after `apt update`, so I don't think it's a local config
issue.  Sample at the bottom.

The internet says "just use dpkg -i" - fair enough.  But I was hoping to
find an explanation of what's going on.  I have some uneducated guesses,
but the internet has enough of those :).

Thanks in advance,
Ross

(please cc me, I'm not subscribed to this list)


$ docker run -it --rm -v $PWD:/root/deb debian:bookworm
root@b451e94c3f56:/# apt update -qq
All packages are up to date.
root@b451e94c3f56:/# apt install -oDebug::pkgPolicy=1 /root/deb/zstd_1.5.4+dfsg2-5_amd64.deb
Reading package lists... Done
Prio of /root/deb/zstd_1.5.4+dfsg2-5_amd64.deb 500
Prio of /var/lib/dpkg/status 100
Prio of /var/lib/apt/lists/deb.debian.org_debian-security_dists_bookworm-security_main_binary-amd64_Packages.lz4 500
Prio of /var/lib/apt/lists/deb.debian.org_debian_dists_bookworm_main_binary-amd64_Packages.lz4 500
Building dependency tree... Done
Reading state information... Done
Note, selecting 'zstd' instead of '/root/deb/zstd_1.5.4+dfsg2-5_amd64.deb'
The following NEW packages will be installed:
  zstd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 701 kB of archives.
After this operation, 2152 kB of additional disk space will be used.
Get:1 http://deb.debian.org/debian bookworm/main amd64 zstd amd64 1.5.4+dfsg2-5 [701 kB]
Fetched 701 kB in 0s (5209 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package zstd.
(Reading database ... 6098 files and directories currently installed.)
Preparing to unpack .../zstd_1.5.4+dfsg2-5_amd64.deb ...
Unpacking zstd (1.5.4+dfsg2-5) ...
Setting up zstd (1.5.4+dfsg2-5) ...


Reply to: