Issues with apt-get, NTPD timesync with DietPi

I was trying to install iptables on DietPi. First attempt was via dietpi-config - software install. What I got was NTPD was not syncing, no matter how long I waited or how many times I tried. Then I decided to use apt-get, without success. It can’t resolve deb.debian.org. This is when I type apt-get update.

This happened after I ran dietpi-config and changed regional settings to reflect my local timezone, region, and keyboard layout to basically USA, en_us, central time, and corresponding keyboard layout.

I am not that proficient with linux, so any help for a newbie is gratefully accepted… :slight_smile:

Hi,

Your DietPi is running v6.1?
Which device? RPi?

Sound for me with given information like this: Setting locale failed

If so, it will only happen under rare circumstance, direct after fresh setup.
Apologies, this is an issue our end.

In short:

  • It was a difficult and longsome fix (thanks go to @Fourdee and @MichaIng).
  • Is fixed with Update v6.2
  • Quick and easy solution will be to start with a fresh DietPi v6 image , which will be auto-updated to v6.2 during inital setup.

Oops, I forgot to include that info. I keep forgetting such details:

DietPi 6.1 on VirtualBox, used the corresponding VM appliance on the homepage.

I will try a fresh install, let it autoupdate to 6.2 and see what happens.

Okay, a follow up.

I re-did the VM image with a fresh appliance import of DietPi 6.0. I even downloaded the fresh copy from the dietpi website.
Went through the guided installation, and it updated to DietPi 6.2, I changed the locale to fit my region - English, US, Central Time, US 105 key layout, English plain. Then I changed my IP address to STATIC and configured gateway, DNS servers. Then I installed PiHole via dietpi-config, went through its setup procedures, configured everything, left IPv6 disabled.

Rebooted, and NTPD stopped working. I did a internet connection test, and it failed. I switched it back to DHCP, and rebooted. No matter how many times I save the config and reboot, it would stay on STATIC ip.

At the moment, the DietPi virtual machine is dead in the water.

DietPi 6.2
VirtualBox VM via image from DietPi website

I’ve seen this as well even when the time was synced.

The difference for me is that I am running as daemon & drift synchronising.

I go in and edit the /etc/network/interfaces file to set up the ethernet and wifi interface parameters that I need as I need both working. Google the path and you will get lots of examples on what it should look like.

That may not be the cool way of doing it though. :open_mouth:

Gord_W

Network is not the issue. NTP sync is.

Ref:
https://github.com/Fourdee/DietPi/issues/1445

Hmm

I am going to do three things, as I need to have a working PiHole:

  1. I am going to bring my backup back online with DietPi v159 - PiHole was working well on it. Keep that running until I can get DietPi 6.x working.

  2. Troubleshoot further. As my DietPi 6.2 is dead in the water anyway, it would not hurt to edit the aforementioned files manually - what text editor is available in DietPi by default? I can’t install anything at present, and I only installed PiHole, no other software from dietpi-config.

  3. How would I go about troubleshooting NTPD, and resolving it?

Thanks for all the help, everyone! It is appreciated.

Just saw FourDee’s post regarding GitHub Issue # 1445.

When I first encountered the problem, I got the described TimeSync issue (Retry / Override).

Redid this.

Now I just do not get any network connectivity, so NTPD is definitely failing. Can’t ping my virtual machine, virtual machine fails internet test within dietpi-config.

Only read partway down the issue.

Will continue reading and catch up…

Hi ptrinh1979,



nano

Same here.

I discovered minimum two issues here. the config file entry is not correct and at boot time is not working.

To fix the config file is quite easy. Pease do:

nano /etc/systemd/timesyncd.conf

correct the entry server=… to FallbackNTP=… and done.

At boot time you will have the issue but it will fix the time at the next hour or if you run the following command manually:

systemctl restart systemd-timesyncd

Hi,

you reacted on a 2 years old entry. Not sure if there is any relation to your issue.

usually your config file should looks like this:

root@DietPi3:~# cat /etc/systemd/timesyncd.conf
[Time]
Servers=0.pool.ntp.org 1.pool.ntp.org 2.pool.ntp.org 3.pool.ntp.org
root@DietPi3:~#

next to this, the time server can be changed using dietpi-config tool.
and yes, during boot systemd-timesyncd is executed already and will update your system time. To check you can do the following after reboot

journalctl -u systemd-timesyncd.service
systemctl status systemd-timesyncd.service

if system time is not updated during boot, something seems to be wrong on your device.