Closed joshheinrichs-shopify closed 1 year ago
I dug into this a bit deeper and it looks like apt
and apt-config
set their lock timeout based on Binary::apt::Dpkg::Lock::Timeout
rather than DPkg::Lock::Timeout
.
It's still probably better to use apt-get than apt, but we don't absolutely need this if apt's output is highly desirable in interactive contexts.
One of the benefits of apt
is it has a better ANSI progress bar and friendlier output. Maybe we could fallback to apt-get
if stdout is not a TTY (ex: if [[ -t 1 ]]; then
).
👍 if this becomes a common theme, switching based on whether we're a tty / a env var or something makes sense, but for the sake of simplicity i'm happy to stick with apt as the sole front end since there's a workaround for my specific problem.
When running non-interactively, this message appears in the logs:
This isn't a huge deal, but apt doesn't appear to respect some options in /etc/apt/apt.conf.d/ when ran non-interactively. These options are respected when running apt-get. This is at least true for DPkg::Lock::Timeout, but may apply to other options as well.