Set system time

This guide describes how to reset the time in your Clear Linux* OS system when the default NTP servers cannot be reached.

Clear Linux OS uses the systemd-timesyncd.service daemon to synchronize time.

  1. Install the sysadmin-basic bundle.

    sudo swupd bundle-add sysadmin-basic
    
  2. Set your time zone. This example uses Los Angeles.

    timedatectl set-timezone America/Los_Angeles
    

    Note

    To see a list of time zones, use the command: timedatectl list-timezones | grep <locale>

  3. Create a /etc/systemd/ directory.

    sudo mkdir -p /etc/systemd/
    
  4. Create a new file named /etc/systemd/timesyncd.conf and enter the following text.

    [Time]
    NTP=<Preferred Server>
    FallbackNTP=<backup server 1> <backup server 2>
    
  5. Enable the systemd-timesyncd service.

    sudo timedatectl set-ntp true
    

Note

To check the service status, use the timedatectl status command.

To restart the timesyncd daemon, enter systemctl restart systemd-timesyncd into your terminal emulator.

Congratulations! You successfully set up the time in your Clear Linux OS system.