Skip to content

pkg: prevent interactive dpkg prompts in automated builds#884

Merged
igorpecovnik merged 1 commit intomainfrom
fix/pkg-noninteractive-prompts
Apr 21, 2026
Merged

pkg: prevent interactive dpkg prompts in automated builds#884
igorpecovnik merged 1 commit intomainfrom
fix/pkg-noninteractive-prompts

Conversation

@igorpecovnik
Copy link
Copy Markdown
Member

@igorpecovnik igorpecovnik commented Apr 21, 2026

Summary

Fixes "end of file on stdin at conffile prompt" errors during automated builds by ensuring all apt-get and dpkg operations run non-interactively.

Problem

During automated builds, dpkg was prompting for conffile decisions (e.g., chromium master_preferences), causing the build to fail with "end of file on stdin at conffile prompt" errors.

Root Cause

The package management functions had inconsistent handling of DEBIAN_FRONTEND=noninteractive:

  • Dialog mode had it explicitly set
  • Read mode (used in automated builds) was missing it
  • dpkg --configure fallbacks were missing it
  • An export in desktops.sh wouldn't work in chroot environments

Solution

  • Added DEBIAN_FRONTEND=noninteractive to all apt-get commands in read mode
  • Added DEBIAN_FRONTEND=noninteractive to dpkg --configure fallbacks
  • Removed redundant export from desktops module (now handled centrally)

Benefits

  • ✅ Works in all contexts: chroot, subshells, automated builds
  • ✅ No reliance on environment variable exports
  • ✅ Centralized handling in package functions
  • ✅ Prevents all interactive prompts during package operations

Test Plan

  • Bash syntax check passes
  • Changes verified in both files
  • Test in automated build environment with chromium or similar package that has conffile prompts

@github-actions github-actions Bot added size/small PR with less then 50 lines 05 Milestone: Second quarter release labels Apr 21, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 21, 2026

Walkthrough

This change relocates the DEBIAN_FRONTEND=noninteractive environment variable handling from a global export in the desktop installation module to being applied inline within package management functions. The global export in module_desktops.sh is removed and replaced with inline documentation explaining the change. The actual noninteractive behavior is now set directly in apt_operation_progress during read mode operations and in pkg_install/pkg_remove when handling dpkg --configure operations, maintaining functional equivalence while centralizing the setting at the point of execution.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: preventing interactive dpkg prompts during automated builds by applying DEBIAN_FRONTEND=noninteractive, which matches the core objective of the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The pull request description is directly related to the changeset, clearly explaining the problem (dpkg prompts during automated builds), root cause (inconsistent DEBIAN_FRONTEND handling), and solution (adding noninteractive flags to apt-get and dpkg operations).

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/pkg-noninteractive-prompts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Fix "end of file on stdin at conffile prompt" errors by ensuring
DEBIAN_FRONTEND=noninteractive is set for all apt-get and dpkg
operations in package management functions.

Changes:
- Add DEBIAN_FRONTEND=noninteractive to apt-get commands in read mode
- Add DEBIAN_FRONTEND=noninteractive to dpkg --configure fallbacks
- Remove redundant export from desktops module (now handled centrally)

This ensures non-interactive operation in all contexts including chroot
environments during automated builds.

Fixes conffile prompt issues (e.g., chromium master_preferences)

Signed-off-by: Igor Pecovnik <igor@armbian.com>
@igorpecovnik igorpecovnik force-pushed the fix/pkg-noninteractive-prompts branch from 128106a to a5291b5 Compare April 21, 2026 11:45
@igorpecovnik igorpecovnik merged commit 27eea9b into main Apr 21, 2026
18 checks passed
@igorpecovnik igorpecovnik deleted the fix/pkg-noninteractive-prompts branch April 21, 2026 11:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

05 Milestone: Second quarter release size/small PR with less then 50 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant