Tzdata update for Russia (system and java in Ubuntu / Debian, as well as in MySQL)
As many remember, a law was passed this year, due to which the time zones in Russia have changed since October 26, 2014. Of course, right after the law was passed, I put a reminder in the beginning of October on the calendar “be sure to update tzdata”. Imagine my surprise when I did not find tzdata updates in debian and ubuntu. I decided to wait a little longer, I came across open bugs in distributions (Ubuntu # 1377813 , # 1371758 , Debian # 761267 ). Colleagues strongly reminded of the need for updates, but the maintainers did not respond. In order not to make a rush to himself by the end of the month, I decided to collect the packages and update manually. It is important to note that information about zones in some software, for example, in MySQL, will need to be updated manually. This is followed by a short manual.
Ubuntu 12.04 / 14.04, Debian 7
By the time I decided to build the updates, the 2014h package appeared in debian wheezy and almost immediately in ubuntu utopic, so I just took tzdata_2014h-2.dsc, tzdata_2014h.orig.tar.gz, tzdata_2014h-2.debian.tar.xz and collected without any changes.
apt-get install devscripts dpkg-dev debhelper build-essential
Unpacked the source:
dpkg-source -x tzdata_2014h-2.dsc cd tzdata-2014h
I installed the dependencies, corrected the version and compiled:
apt-get install default-jre-headless rdfind symlinks dch -i dpkg-buildpackage -rfakeroot cd ../
It remains to install:
dpkg -i tzdata*deb
Ubuntu 10.04, Debian 6
The algorithm for old distributions is practically the same, the only difference is that the rdfind package is not in the distribution. The easiest way was to collect it.
Sources were taken from debian packages.debian.org/wheezy/rdfind , dependencies were installed and a deb package was built.
dpkg-source -x rdfind_1.3.1-1.dsc apt-get install nettle-dev cd rdfind-1.3.0/ dpkg-buildpackage -rfakeroot cd ../ dpkg -i rdfind*deb
UPD: Will not work if time_zone = SYSTEM. Solution without restarting - SET GLOBAL time_zone = 'Europe / Moscow'; or SET GLOBAL time_zone = '+03: 00' if the tables are not updated;
After updating the system tzdata, you need to get tzinfo for MySQL with the script from the kit:
mysql_tzinfo_to_sql /usr/share/zoneinfo > /tmp/tzinfo-mysql-2014h-2.sql
Next, fill this file in MySQL. We are connected with root privileges, for example, like this:
Choose the base, encoding and file:
use mysql set names utf8; source /tmp/tzinfo-mysql-2014h-2.sql
At the time this post was written, ubuntu maintainers probably responded to my email at ubuntu-devel-discuss and pushed updates to proposed. Probably in the coming days tzdata updates will arrive from official repositories, but MySQL will still need to be updated manually.
UPD For OpenJDK, updates will be delivered with the system ones, and for Sun / Oracle Java you need to use the "proprietary" utility .
UPD2. Ernillew instructions on how to configure proposed: habrahabr.ru/post/240937/#comment_8080009 . UPD3. 2014i appeared in trusty, which includes previous changes and new ones for Belarus. "Tzdata" versions published in Ubuntu
As of 2014-10-23 09:31 +0400 (info from launchpad.net/ubuntu/+source/tzdata/+bugs )
Trusty-security (2014i-0ubuntu0.14.04): main/libs Trusty-updates (2014i-0ubuntu0.14.04): main/libs Precise-security (2014i-0ubuntu0.12.04): main/libs Precise-updates (2014i-0ubuntu0.12.04): main/libs Lucid-security (2014i-0ubuntu0.10.04): main/libs Lucid-updates (2014i-0ubuntu0.10.04): main/libs Utopic-proposed (2014i-0ubuntu0.14.10): main/libs Trusty-proposed (2014i-0ubuntu0.14.04): main/libs Precise-proposed (2014i-0ubuntu0.12.04): main/libs Lucid-proposed (2014i-0ubuntu0.10.04): main/libs Utopic (2014h-2): main/libs Trusty (2014b-1): main/libs Precise (2012b-1): main/libs Lucid (2010i-1): main/libs
UPD4. For PHP in some configurations you may need
pecl install timezonedb echo "extension=timezonedb.so" > /etc/php5/conf.d/timezonedb.ini # или, если уже было установлено pecl upgrade timezonedb