Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I've tried tzselect and all it appears to do is tell me what region I want to pick.

I'm trying to change tz without a restart and for all users, then sync the time accordingly.

share|improve this question
    
A lot of programs only read the timezone when they start. While you don't need to reboot, you may need to restart a few programs. –  Gilles Dec 5 '12 at 23:31

1 Answer 1

up vote 3 down vote accepted

Try:

dpkg-reconfigure tzdata

That should allow to set the timezone for the system (make a copy of the selected timezone file onto /etc/timezone).

More generally, it can be difficult to figure out which package you need to configure to change a setting as it's not always obvious. Things that can help:

If you know the configure file where that setting is stored, you can try.

dpkg -S that-file

However, the configuration file may not always be part of the package but generated by the package configuration in which case it wouldn't show up there.

Something that often works is to look for the setting you're after in the .config files for every installed packages. For instance:

$ grep -il timezone /var/lib/dpkg/info/*.config
/var/lib/dpkg/info/tzdata.config

That tells us tzdata is a good candidate.

If you know the current setting value, you can look it up in the debconf store:

$ awk -v RS= '/Value:/ && /London/' /var/cache/debconf/config.dat
Name: tzdata/Zones/Europe
Template: tzdata/Zones/Europe
Value: London
Owners: tzdata
Flags: seen
share|improve this answer
    
Where can I get that package from? –  user1561108 Dec 5 '12 at 20:22
    
It's already installed. That's one of the base packages. You configured it initially during installation. That where you specified your current timezone. You need to reconfigure it to select a different timezone. –  Stéphane Chazelas Dec 5 '12 at 20:31
    
thanks, must have made a spelling error earlier. –  user1561108 Dec 5 '12 at 20:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.