[CentOS] how to properly change the timezone

Thu Jul 8 01:41:02 UTC 2010
Nataraj <incoming-centos at rjl.com>

Stephen Harris wrote:
>> I have a Centos 5.5 server with no GUI installed.   I have several times 
>> changed the timezone by copying the correct file to /etc/localtime, 
>> however something keeps changing it back.  I'm not sure if this is a yum 
>> update or what.  Without installing the graphical tools, how can I 
>> update the timezone in such a way that the /etc/localtime file won't 
>> keep getting clobbered.
> /usr/bin/system-config-time
> (from the system-config-date RPM package)
> It will work in text mode.
> (Essentially /etc/sysconfig/clock is the config file that also needs
> updating)
Thank you. I'm hoping that the problem was caused by not updating 
/etc/sysconfig/clock which I have done now. I'm guessing that when the 
tzdata package gets updated it copies the latest timezone file to 
/etc/localtime, based on the timezone specified in /etc/sysconfig/clock.

I tried yum installing system-config-time, but it wanted to install two 
pages worth of additional dependancies. I'm trying to keep my server 
installations a little less bloated.

There where no symbolic links. All I had done was to copy the correct 
timezone file to the file /etc/localtime. Some have warned that symbolic 
links are a bad idea, because then if something tries to update the 
timezone it may clobber the data file in /usr/share/zoneinfo.