Raspberry Pi - Kali 2024 NTP Bug Fix

Raspberry Pi - Kali 2024 NTP Bug Fix

Raspberry Pi - Kali 2024 NTP Bug Fix

If you have a Raspberry Pi running Kali and did a recent update you may have found that the NTP service was no longer working correctly.

Now, this could have stemmed from the current version before updating to Kali 2024 but in my experience that is little unclear.

When updating to Kali 2024 on the Raspberry Pi I first noticed that I couldn't perform "apt update". After some reading, it was pointed out that Kali prevents updates from a source that is configured for HTTP. So, I started there and made a change to /etc/apt/sources.list

$ cat /etc/apt/sources.list
# See https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/
deb http://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware


# Additional line for source packages
# deb-src http://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware



$ vim /etc/apt/sources.list
...

$ cat /etc/apt/sources.list
# See https://www.kali.org/docs/general-use/kali-linux-sources-list-repositories/
deb https://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware


# Additional line for source packages
# deb-src http://http.kali.org/kali kali-rolling main contrib non-free non-free-firmware

After making the changes, I was still getting errors related to "Release file for https://http.kali.org/kali/dists/kali-rolling/InRelease is not valid yet (invalid for another 36days 12min 3s). Updates for this repository will not be applied."

That is when I noticed that my OS date and time was off so I went to the taskbar clock, right-clicked, went to properties and adjusted my date and time. After that, I attempted to "apt update" again and everything began working as expected.

As of this writing, it dawned on me that the change to HTTPS may not have been necessary. So I reverted my changes to the source.list and ran "apt update" and it works just fine as HTTP.

Great, so now my Pi has been updated to Kali 2024!

At this point I attempted to continue my project. I needed to install some packages that are not installed with Kali by default, so I ran "apt update" to ensure everything was good to go and boom, there was the time issue again. Note: I had done a shutdown after the update because I was moving my gear around.

When trying to set the date in time in the GUI taskbar and changing the Configuration from "Manual" to "Keep synchronized with Internet servers" I kept getting errors saying that "NTP support is not installed". So, setting it manually would work for the moment, but would result in the incorrect date and time after each reboot, breaking Kali all over again.

This was causing certificates to appear invalid, APT wouldn't work etc.. Yeah, a PITA!

So, back to the web searches I went.

Finally, I came across a blog that didn't go in too much detail, but it was something else I could try. So I went for it.

From the terminal I ran the following:

$ timedatectl
...

With this I noticed that the NTP Service was "inactive". I tried to set it by running "timedatectl set-ntp true" amd that just resulted in an error message.

So, I went ahead with the next step. Of course, I had to be sure my date and time was set correctly first as I did above.

$ sudo apt install systemd-timesyncd
...

$ timedatectl
...

Now, timedatectl reports that the NTP Service is "active". I went ahead and set the Time Zone and then did a reboot to see if this fixed everything.

$ sudo timedatectl set-timezone America/New_York
...

$ sudo shutdown -r now

Once the Pi had rebooted, I ran timedatectl again and noticed that the NTP Service was still set to active and that my date and time were still set correctly.

Reading multiple related posts online, this appears to be a bug in Kali 2024 but that is a little unclear to me to be honest because my Kali install prior to doing the update to 2024 version also had the incorrect date and time that had to be corrected manually before doing the package update and upgrade.

I would be curious to see if anyone else has run into this issue and how they went about fixing it. Leave your thoughts in the comments below!

Back to blog

Leave a comment

Please note, comments need to be approved before they are published.