lib.distros.debian.Distro._install(): Protect installed pkgs #171

Merged
Jan Lindemann merged 1 commit from jan/feature/20261108-lib-distros-debian-distro-install-protect-installed-pkgs into master 2026-11-08 13:24:26 +01:00 AGit
Owner

lib.distros.debian.Distro._install(): Protect installed pkgs

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.

#### lib.distros.debian.Distro._install(): Protect installed pkgs 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.
lib.distros.debian.Distro._install(): Protect installed pkgs
All checks were successful
CI / Packaging - Kali Linux (pull_request) Successful in 5m14s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Successful in 5m30s
CI / Packaging test (pull_request) Successful in 0s
302d3fe791
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>
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-11-08 13:13:37 +01:00
Jan Lindemann scheduled this pull request to auto merge when all checks succeed 2026-11-08 13:14:46 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
janware/jw-pkg!171
No description provided.