apt 3.x distinguishes versions with the same version number by their
control metadata, so a .deb installed with dpkg -i that differs from the
repository's same-version package is regarded as a separate version, and
apt-get install of the package name "upgrades" it to the repository
version, replacing the installed package. If the installed package was
built from the source code repo's master, this is effectively a downgrade
and can break a CI run in currently unintended ways.
This commit detects same-version packages in apt-get's install todo list by
running apt-get -s install (simulate installation), parsing the output, and
removing those packages from the command line of the subsequent, real
install command.
Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.5.0
Signed-off-by: Jan Lindemann <jan@janware.com>