sudo apt update error: "Release file is not yet valid"
Run:
sudo hwclock --hctosys
This command gets the latest time from your Windows machine’s RTC and sets the system time to that.
This is a timezone issue. Try restarting your Docker host. It worked for me.
Tested on ubuntu 18.04 server:
- check BIOS date-time, check also the coin cell in the motherboard and replace if needed.
- restart. Execute command
date
to verify that date time is correct. - execute
sudo apt update
again. Problems are gone.
In my case:
- Microsoft Windows [Version 10.0.19041.630];
- WSL version 2;
- Ubuntu-20.04;
The date
command reports a wrong date and time.
I used the following:
sudo apt install ntp
sudo service ntp restart
Then the date
command reports the correct data and time. sudo apt update
now can work.
You can use this temporary workaround, given by leon-strong:
apt-get -o Acquire::Check-Valid-Until=false -o Acquire::Check-Date=false update
See the bug report https://github.com/microsoft/WSL/issues/4114 for more details.