Time synchronization failed

gene_x 0 like s 14 view s

Tags: processing

https://askubuntu.com/questions/1046214/enable-system-clock-synchronization

Steps to Enable NTP Support 1. Check if systemd-timesyncd is Running

Ensure that the default time synchronization service is installed and active. Run:

sudo systemctl status systemd-timesyncd

If it’s inactive or not installed, enable and start it:

sudo systemctl enable systemd-timesyncd
sudo systemctl start systemd-timesyncd
  1. Install and Configure ntp (if needed)

If systemd-timesyncd is not available or you prefer using ntp, follow these steps:

Install the ntp package:

sudo apt update sudo apt install ntp

Ensure the ntp service is enabled and running:

sudo systemctl enable ntp
sudo systemctl start ntp
  1. Manually Set NTP Servers (Optional)

If you're using systemd-timesyncd, you can configure NTP servers in /etc/systemd/timesyncd.conf. Open the file:

sudo vim /etc/systemd/timesyncd.conf

Add or edit the following lines to include your preferred NTP servers:

[Time] NTP=time.google.com 1.de.pool.ntp.org 2.de.pool.ntp.org

Save the file and restart the service:

sudo systemctl restart systemd-timesyncd

  1. Force Synchronization

After ensuring the service is running, you can force synchronization:

sudo timedatectl set-ntp false sudo timedatectl set-ntp true

  1. Verify Synchronization

Check the time status again:

timedatectl

Confirm that System clock synchronized: yes is displayed.


Steps to Resolve 1. Check for systemd-timesyncd Installation

Run the following command to see if systemd-timesyncd is installed:

sudo systemctl status systemd-timesyncd

If the service is not found, install and enable it:

sudo apt update
sudo apt install systemd-timesyncd
sudo systemctl enable systemd-timesyncd
sudo systemctl start systemd-timesyncd
  1. Verify NTP Settings

Check if the configuration for NTP servers is correct. Open the file /etc/systemd/timesyncd.conf:

sudo nano /etc/systemd/timesyncd.conf

Ensure the [Time] section includes valid NTP servers:

[Time] NTP=time.google.com 1.de.pool.ntp.org 2.de.pool.ntp.org

Save the file and restart the service:

sudo systemctl restart systemd-timesyncd

  1. Manually Enable NTP Synchronization

If the service is installed and running but synchronization is still not active, force-enable NTP:

sudo timedatectl set-ntp true

  1. Install ntp as an Alternative (Optional)

If systemd-timesyncd is not sufficient or unavailable, you can install and use the ntp package:

sudo apt update sudo apt install ntp sudo systemctl enable ntp sudo systemctl start ntp

  1. Check Synchronization Status

Recheck the time synchronization status:

timedatectl

Look for System clock synchronized: yes.

like unlike

点赞本文的读者

还没有人对此文章表态


本文有评论

没有评论

看文章,发评论,不要沉默


© 2023 XGenes.com Impressum