apt-get install tzdata noninteractive

This is the script I used

(Updated Version with input from @elquimista from the comments)

#!/bin/bash

ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime
DEBIAN_FRONTEND=noninteractive apt-get install -y tzdata
dpkg-reconfigure --frontend noninteractive tzdata

Seems to work fine.

As one liner:

DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends tzdata

Leave a Comment