Technical Anshu
Tutorials Blog
🐧 Ubuntu Clock Fix

Release File Is Not Valid Yet Fix the Ubuntu Clock First

The error mentions hours and minutes, not packages - because this failure is about time itself. apt is refusing a repository file that appears to come from the future. Fix the clock and the error disappears without touching a single repository.

✍️ Technical Anshu🐧 Ubuntu / Linux⏱️ 5 minute read
🎥 Watch the full video - the apt-get update fix shown live, step by step

Of all apt errors, this is the most honest one: "Release file is not valid yet" tells you the exact problem and even counts down how long apt would wait. Your PC's clock disagrees with the repository's timestamps, and apt sides with the repository. This page shows how to check the clock, switch automatic time sync back on, and deal with the two repeat offenders - dual-boot machines and a dying CMOS battery.

Terminal - apt rejects the repository because of time
$ sudo apt update Get:1 http://archive.ubuntu.com/ubuntu jammy InRelease [270 kB] Reading package lists... Done E: Release file for http://archive.ubuntu.com/ubuntu dists/jammy-updates/InRelease is not valid yet (invalid for another 2h 41min 7s). Updates for this repository will not be applied.
This exact wording - not valid yet, with a countdown - is apt protecting you. The repository file is dated in what your PC thinks is the future. Times and releases shown are examples.
1

Why a Wrong Clock Breaks apt at All

Every Ubuntu repository publishes a signed Release file stamped with the date and time it was created, and a date until which it stays valid. apt checks that stamp against your PC's clock. If your clock is behind - say the machine thinks it is Tuesday while the repository file was signed on Thursday - apt concludes the file is "from the future", refuses to trust it, and prints not valid yet along with how long it intends to wait. It is a security feature working correctly against a clock that is lying.

The good news: nothing about your repositories, keys or installation is damaged. Fix the time and the same command succeeds, usually within a minute.

2

Check What Your PC Thinks the Time Is

  1. Run date. Compare it with your phone. A wrong year, month or a few hours' difference all count - apt cares about all of them.
  2. Run timedatectl and read three lines: Local time, Universal time, and System clock synchronized. If synchronized says no, the PC is not correcting itself from the internet.
  3. On a dual-boot PC that also runs Windows, suspect this first: Windows keeps the hardware clock on local time and Ubuntu expects UTC, so each system keeps shifting the clock for the other. The clock is wrong every time you switch systems - and apt fails every time too.
3

Turn On Network Time and Let It Settle

True
4

If the Clock Keeps Drifting Back

A clock that is wrong again after every shutdown is not a software setting - the small coin battery on the motherboard (the CMOS battery) that keeps time while the PC is off is dying. It costs very little and any computer shop can change it in minutes; on a laptop it may need a service visit. Until it is replaced, the quick workaround is the same each boot: connect to the internet, give NTP a minute, then update. Do not fight it by editing repository files or disabling apt's validity checks - the clock is the problem, and it is also the cheapest fix on this page.

🔴 Resist one tempting shortcut: do not set your clock forward by hand just to pass the check, and do not disable apt's date verification. A wrong clock also breaks website certificates, logins and file timestamps all over the system. Fixing the time properly fixes all of them at once.

🎥 Watch the Complete Video for Full Knowledge and Installation

The video shows the failing update, the clock check and the successful rerun on a real Ubuntu machine.

▶️ Watch Full Video
❓ Common Questions (FAQ)

Why does apt care what time my PC thinks it is?

Repository Release files are digitally signed and carry a creation date and a validity window. apt compares those dates with your system clock to make sure it is not being fed an old, replayed or tampered package list. If your clock is set before the file was created, the file looks like it comes from the future, so apt refuses it and reports that it is not valid yet.

My clock is correct but I still get this error. What now?

Check the time zone with timedatectl, not just the clock face. If the zone is wrong, the displayed time can look right while the underlying UTC time is hours off, and apt works in UTC. Also make sure System clock synchronized says yes. If both are right and the error stays, the mirror you use may be mid-sync - wait an hour and try again before changing anything else.

Why does this happen every time I boot from Windows into Ubuntu?

Windows stores local time in the PC's hardware clock while Ubuntu stores UTC and converts for display. Each operating system reads the other's setting as its own, so the clock jumps by your time zone offset on every switch. Enabling network time sync on Ubuntu corrects it automatically a minute after boot; the permanent cure is to make one system match the other's convention.

This guide is based on the Technical Anshu video on the Ubuntu clock and Release file error • Stuck on a step? Ask in the video comments - answers live there 🙏