How do you know apt took it from /var/cache/apt/archives and not from the folder you pointed it at?
You can prove that by removing the files from /var/cache/apt/archives, remove the installed package, and doing the install command again.
Also, you gave us the command line options for apt-get, not apt.
Using your package as an example, I downloaded a random deb, and used apt to install it. There’s nothing in /var/cache/apt/archives, it’s using the deb I gave it.
ubuntu@ubuntu:~$ ls -l mupdf-tools_1.23.10+ds1-1build3_amd64.deb
-rw-r--r-- 1 ubuntu ubuntu 49338050 Apr 15 2024 mupdf-tools_1.23.10+ds1-1build3_amd64.deb
ubuntu@ubuntu:~$ ls -l /var/cache/apt/archives
total 1
-rw-r----- 1 root root 0 Mar 21 13:14 lock
drwx------ 2 _apt root 2 May 5 23:03 partial
ubuntu@ubuntu:~$ sudo apt install ./mupdf-tools_1.23.10+ds1-1build3_amd64.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'mupdf-tools' instead of './mupdf-tools_1.23.10+ds1-1build3_amd64.deb'
The following additional packages will be installed:
libfreetype6 libgraphite2-3 libgumbo2 libharfbuzz0b libjbig2dec0 libjpeg-turbo8 libjpeg8 libmujs3 libopenjp2-7
The following NEW packages will be installed:
libfreetype6 libgraphite2-3 libgumbo2 libharfbuzz0b libjbig2dec0 libjpeg-turbo8 libjpeg8 libmujs3 libopenjp2-7 mupdf-tools
0 upgraded, 10 newly installed, 0 to remove and 71 not upgraded.
Need to get 50.9 MB of archives.
After this operation, 92.7 MB of additional disk space will be used.
Do you want to continue? [Y/n]
The line you quoted doesn’t mean what you assume it means:
Note, selecting 'mupdf-tools' instead of './mupdf-tools_1.23.10+ds1-1build3_amd64.deb'
It’s just informing you of the actual package name that will be used for dependency calculations, and what it will show up as once installed. i.e. when you install it, then use apt or dpkg to list installed packages, you will see mupdf-tools not mupdf-tools_1.23.10+ds1-1build3_amd64.deb in the output.
Similarly in my output above, it says:
Note, selecting 'steam-launcher' instead of './steam_latest.deb'
Because the package name is steam-launcher, while the filename is steam_latest.deb (exactly as it came from the valve website).
Here it is post-install:
ubuntu@ubuntu:~$ dpkg -l steam-launcher
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-==============-============-============-====================================================
ii steam-launcher 1:1.0.0.85 amd64 Launcher for the Steam software distribution service
Installed as steam-launcher, as discovered from the steam_latest.deb file. Here’s proof it was manually installed - by apt - just as if it had been installed with dpkg.
ubuntu@ubuntu:~$ apt-cache policy steam-launcher
steam-launcher:
Installed: 1:1.0.0.85
Candidate: 1:1.0.0.85
Version table:
*** 1:1.0.0.85 100
100 /var/lib/dpkg/status
Indeed you can even rename the .deb file to anything you like, and you’ll see the same kind of thing:
ubuntu@ubuntu:~$ mv mupdf-tools_1.23.10+ds1-1build3_amd64.deb foo_bar_baz_nonsense_nobody_cares.deb
ubuntu@ubuntu:~$ sudo apt install ./foo_bar_baz_nonsense_nobody_cares.deb
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'mupdf-tools' instead of './foo_bar_baz_nonsense_nobody_cares.deb'
The following additional packages will be installed:
libfreetype6 libgraphite2-3 libgumbo2 libharfbuzz0b libjbig2dec0 libjpeg-turbo8 libjpeg8 libmujs3 libopenjp2-7
The following NEW packages will be installed:
libfreetype6 libgraphite2-3 libgumbo2 libharfbuzz0b libjbig2dec0 libjpeg-turbo8 libjpeg8 libmujs3 libopenjp2-7 mupdf-tools
0 upgraded, 10 newly installed, 0 to remove and 71 not upgraded.
Need to get 50.9 MB of archives.
After this operation, 92.7 MB of additional disk space will be used.
Do you want to continue? [Y/n]