Hi, On Fri, Jul 23, 2021 at 09:44:43PM -0500, ng wrote: > Today I ran 'sudo apt purge ./anything.deb' on a package that WAS NOT > installed in my system. And apt's response was to install that package, as > if I were running 'apt install'. Except that it was 'apt purge'. > Funny. Try: "apt remove awesome+". This will install 'awesome' for you. Just like a "apt install awesome-" will then remove it again. The commands "remove/install/purge/…" only provide a default mode of operation for packages which do not have an explicit action associated. Now, for ./anything.deb you can consider two schools of thought: 1. "./anything.deb" clearly means I want to install that package as why I am going to the trouble of giving an explicit deb file, if I could just use the name and remove it that way. So this clearly is an explicit install action regardless of the default mode. ("apt show ./anything.deb" shows me the info about that version, too, not some candidate as usual). 2. "./anything.deb" is a substitute for the name only, I am using it in a remove because I just installed it and shell history gives me quick access to removing it this way. I am expecting it to respect the default mode (and to be able to explicitly choose a mode ala "./anything.deb+"; and would a "apt purge ./anything_v1.deb" remove an installed anything v2?). For better or worse the implementation currently follows the first school, which can indeed be surprising if you (by not considering what I just mentioned with default vs. explicit action) think the second is what is going on as that is how most other software behaves. I do have some sympathy for both schools, so I am not really sure what to do about this report here to be honest. I do lean slightly towards notabug + wontfix though as (even though highly unlikely in practice) a change of schools would be an interface break – and it has these weird follow up questions of potentially allowing ./anything.deb{-,+,=…} as well which makes this not so simple… Best regards David Kalnischkies
Attachment:
signature.asc
Description: PGP signature