By default the Eee has no way to use automatic clock adjusting, like we all know from Windows XP and nearly any Linux distribution.
ntpdate command is used, but it is not installed in a default Eee environment. You can install it, as shown below, to use widely-available NTP servers, or use the
rdate command which is present in all Eee installations, if you have access to an rdate server on your network. Servers offering rdate time service are much rarer than ntp servers!
Note: In editing text files as root, be very careful not to edit other parts of the operating system. The easiest text editor to use is probably kwrite, as shown below, but this does give worrying messages about running “kbuildsyscoca” when you start it. I am told this is quite safe. If you know vi commands, that is probably a quicker and less worrying way to edit text files. If you know vi, use “vi” instead of “kwrite” in what follows!
ntpdate from the debian sarge repositories:
sudo kwrite /etc/apt/sources.list
deb http://ftp.de.debian.org/debian sarge main)
sudo apt-get updateto let your package system see ntpdate
sudo apt-get install ntpdateto install the package
/etc/apt/sources.listwith your editor and run
Both rdate and ntpdate connect to a time-server once, synchronize the time, and exit. In these instructions, we aim to run this command once the network is connected; this keeps the load on time-servers low, and gets you the right time every time you connect to a network. These commands do not compensate for clock drift, so you will need to run the ntpdate or rdate command regularly to keep your machine synchronized if it is never rebooted. Use the cron command to do this if you need to!
One good place for adjusting the time is the
/etc/network/if-up.d/ directory. The scripts inside this directory are run each time a network interface is brought up. AFAIK it doesn't matter which interface type, so the following should work for wired, wireless and PPP connections.
At first find a timeserver near you: http://www.pool.ntp.org/ For the UK, for example, this would be
Then open a terminal (Ctrl+Alt+T).
Use the command
sudo kwrite /etc/network/if-up.d/settime to open the kwrite editor with a new file called settime in this directory.
Enter the following in the editor:
#!/bin/sh /usr/sbin/ntpdate 0.uk.pool.ntp.org
if using ntpdate, or, if you are using rdate:
#!/bin/sh /usr/sbin/rdate -s ptbtime1.ptb.de
0.uk.pool.ntp.org you should use your nearest timeserver.
Save the file (using the kwrite menu, or ZZ if you use vi)
Now the file must be marked executable:
sudo chmod +x /etc/network/if-up.d/settime
To test, set the clock to a wrong time using the Settings → Date / Time. Then switch back to the console and run the command manually:
The time should be synchronised after the command is finished. Running it this way also lets you see any error-messages, if the server you have chosen is not available, so that you can fix it.
For further tests switch the wireless interface off and back on or just restart the Eee.