When setting up CI pipelines with GitHub Actions on Ubuntu runners, you might encounter this familiar and frustrating interactive prompt during package installation:
Configuring tzdata
------------------
Please select the geographic area in which you live. Subsequent configuration
questions will narrow this down by presenting a list of cities, representing
the time zones in which they are located.
This happens when installing the tzdata
package, which is used to configure timezones. On your local machine, it’s easy to interact with the prompt—but in CI, it causes the workflow to hang or fail.
Luckily, there’s a simple fix.
To prevent the interactive prompt and let the installation proceed automatically, set the DEBIAN_FRONTEND
environment variable to noninteractive
before calling apt-get
. Here's how to do it inside a GitHub Actions workflow:
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up dependencies
run: |
sudo apt-get update
sudo DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
That single environment variable tells apt
to suppress all interactive questions and use default values, allowing your workflow to continue without interruption.
If you're building Docker images or scripts that will also be used in CI, you might want to include this setting there too:
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
This avoids surprises when your Dockerfile is used in different environments.
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.