Sunday, 15 February 2015

Automatically setting the date/time on Snappy Ubuntu Core

The Raspberry Pi 2 doesn't come with an RTC by default, so when your OS boots it doesn't know what time it is and it defaults to 1970. This breaks all kinds of things, including SSL connections. Here is how to install ntpdate, which will set the correct time on startup (assuming your RPi has network connectivity).

First download the required deb file to your desktop and scp them over to your RPi:
http://ports.ubuntu.com/pool/main/n/ntp/ntpdate_4.2.6.p5+dfsg-3ubuntu4_armhf.deb

Then on the RPi remount the system partition read-write and install the packages:
sudo mount -o remount,rw /
sudo dpkg -i *.deb
sudo mount -o remount,ro /

Now reboot and once done, check with the date command if your system thinks it's 2015. The time will be in UTC, but for most servers that's actually what you want.

Have fun!

No comments: