How to Fix Apt Packages Release File for XY Is Not Valid Yet

As I tried to update my WSL (Windows Subsystem for Linux) installation, I run into this error message:

E: Release file for http://security.ubuntu.com/ubuntu/dists/jammy-security/InRelease is not valid yet (invalid for another 58min 27s). Updates for this repository will not be applied.

How could that be? The difference of nearly an hour got me thinking about a wrong system clock, but on Windows everything was correct. As I checked the date inside WSL, it was indeed way off (at 15:48):

Mon Jan 1 14:16:03 CET 2024

Since the hardware clock (as shown in Windows) was correct, I could fix the time inside WSL by setting the system clock to the value of the hardware clock:

The date util now returned the correct time:

Mon Jan 1 15:49:05 CET 2024

And with the fixed clock I could run apt-get update without any strange error messages.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.