Thursday, May 29, 2008

updating your timezone files.

If your computers use the Asia/Karachi timezone, and your operating system/distribution vendor hasn't updated the timezone packages recently (after May 27 2008), your clock will be off by an hour from June 1 2008 to September 1 2008. Here's how to fix it.

  • Download the latest timezone data. You can find it here (torrent).
  • Unpack it in an empty directory.
  • Install the zic application, if necessary. On most current systems, it's already installed in /usr/sbin (checked on: FreeBSD, Debian/Ubuntu, Centos, Solaris 10).
  • Make a backup of /etc/localtime and /usr/share/zoneinfo (/usr/share/lib/zoneinfo on Solaris).
  • As root, type zic asia. This will overwrite the files in the zoneinfo directory.
  • Use your system's tools to set the timezone to Asia/Karachi, or simply copy the Asia/Karachi file from the zoneinfo directory over /etc/localtime On FreeBSD and NetBSD, the tool is tzsetup. On most Linux distributions, it's tzselect.
  • You may need to restart system services to make them read the new timezone data.

You're done.


  • If you don't want to overwrite the system files, type zic -d . asia instead. It'll create the Asia directory in your current directory.
  • On FreeBSD, update your ports and install (or re-install) the misc/zoneinfo package. It will download and install the latest zoneinfo data. You'll still need to run tzsetup or copy the updated file to /etc/localtime.

1 comment:

Anonymous said...

You might also want to do a /usr/sbin/tzdata-update
so that the change is permanent