[BUGFIX] Debian installer: robust contrib repo detection for deb822 + mirror lists#1677
Conversation
…y across deb822 + mirror lists - Replace `apt-cache policy` grep checks with APT index target parsing to avoid false negatives - Accept Debian suite aliases (stable, stable-updates, stable-security) in addition to codename suites - Add fallbacks for deb822 `*.sources` and classic `sources.list`/`*.list` formats - Prevent repeated “Missing bookworm-updates/contrib” warnings when contrib is already configured
|
|
Does this make any changes to the wiki? |
Sorry. What do you mean? |
|
The ARM Wiki points to Are there changes to this page that are required, or should the Ubuntu automatic script be updated to reflect running the script for those using debian/ubuntu. I have not run this script and do not maintain it, hence asking. |
You are referring to a wiki page that does not apply, this is the Debian Installation script. Not the Ubuntu one. I have not reviewed this change myself but this is a bug I've been trying to track down for a long time now. This seems like a good fix for it. I should test it to see if it works. But I love that this was brought up! I shall review. |
microtechno9000
left a comment
There was a problem hiding this comment.
approving, noting ubuntu and debian wiki just point to this script
894bcf9
into
automatic-ripping-machine:main
… mirror lists (automatic-ripping-machine#1677) fix(installer): correctly detect contrib for bookworm-updates/security across deb822 + mirror lists - Replace `apt-cache policy` grep checks with APT index target parsing to avoid false negatives - Accept Debian suite aliases (stable, stable-updates, stable-security) in addition to codename suites - Add fallbacks for deb822 `*.sources` and classic `sources.list`/`*.list` formats - Prevent repeated “Missing bookworm-updates/contrib” warnings when contrib is already configured



Description
The Debian installer script currently detects
contribrepositories by greppingapt-cache policyoutput for strings likebookworm-updates/contrib. This approach is brittle and produces false negatives on Debian 12 systems using modern APT configurations, especially:/etc/apt/sources.list.d/*.sources)mirror+file:///etc/apt/mirrors/*.listmirror listsAs a result, the installer repeatedly warns that
bookworm-updates/contribis missing even whenComponents: ... contrib ...is correctly configured forbookworm,bookworm-updates, andbookworm-security.This change replaces the fragile
apt-cache policystring matching with a more robust detection strategy:apt-get indextargets(APT’s effective index target list) to confirmComponent: contribfor the relevant suite/codename.stable,stable-updates,stable-security) in addition to codename suites.*.sourcesstanzas and classicsources.list/*.listformats if needed.Behavior is unchanged in terms of requirements:
contribfor the base suite remains requiredupdates/contribandsecurity/contribremain recommended (warn + prompt)Dependencies: none.
Fixes # (issue title here)
Type of change
How Has This Been Tested?
Reproduced and verified on Debian 12 (Bookworm) using deb822 sources with mirror lists:
Example
/etc/apt/sources.list.d/*.sourcesstanza:Steps
.sourcesandmirror+filemirror lists includingcontrib.apt update(ensure indexes refresh successfully).Expected Results
If
bookworm-updatesincludescontrib, the installer should NOT print the warning:Missing bookworm-updates/contrib repository.If
bookworm-updatesdoes NOT includecontrib, the installer should still print the warning and prompt to continue.Docker
Other (Debian 12 Bookworm, deb822
.sources,mirror+filemirror lists)Checklist:
Changelog:
apt-get indextargets(and fallbacks) to avoid false negatives.stable,stable-updates,stable-security) in addition to codename suites.