PDA

View Full Version : Unable to sudo apt-get update keep getting Release file is not valid yet.



Pork59
2022-11-08, 07:56
I do not have much experience in linux but i am having issues with trying to update i keep getting this error


┌──(root㉿kali)-[/home/kali]
└─# sudo apt-get update
Get:1 http://kali.download/kali kali-rolling InRelease [30.6 kB]
Reading package lists... Done
E: Release file for http://http.kali.org/kali/dists/kali-rolling/InRelease is not valid yet (invalid for another 30min 11s). Updates for this repository will not be applied.

I am running kali in a live usb stick and it happens on both of my computers.
I have reinstalled kali multiple times on the usb and it happens even on a fresh install using the latest images available.

I have googled the issue and it seems to have to do something with the computers time being wrong but i have checked and reset it multiple times in bios and os but i have found no solution. if i wait the specified time it will just reset. i have verified that i have internet access all of the solutions on the internet involving the time do not work for me.

a web solution to install NTP service does not work because Sudo apt install (xyz) does not seem to work

──(root㉿kali)-[/home/kali]
└─# sudo apt install ntp
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Package ntp is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'ntp' has no installation candidate

therefore i am stuck. it was working just 2 days ago

higgNewton17
2022-11-09, 23:19
Hi there, I was experiencing the exact same issue while running Kali off of a usb drive. I fixed the issue by setting the correct timezone and enabling NTP synchronization thru the terminal (selecting the correct timezone with the GUI didn't actually change anything). You don't need to have the ntp or ntpdate packages installed to do this.

Here's the article I referenced: https://linuxconfig.org/how-to-set-time-on-kali-linux

Essentially:

1) $ timedatectl list-timezones -to find your timezone

2) $ sudo timedatectl set-timezone Australia/Sydney -to set your timezone (replacing Australia/Sydney)

3) $ timedatectl -verify your timezone has been changed, and notice clock synch is disabled Local time: Sat 2021-01-09 14:15:11 AEDT
Universal time: Sat 2021-01-09 03:15:11 UTC
RTC time: Fri 2021-01-08 09:46:05
Time zone: Australia/Sydney (AEDT, +1100)
System clock synchronized: no
NTP service: n/a
RTC in local TZ: no

4) $ sudo timedatectl set-ntp on -turn on ntp sync

After doing this, you should notice your local machine's time and timezone are now correct (mine was initially showing the correct time, but unchanged timezone) and should be able to do the apt update

Cheers

rokytnji
2022-11-12, 14:42
I entered the url you posted over here

https://downforeveryoneorjustme.com/http.kali.org?proto=http

It told me kali .org is up and the problem is with me. That is what I use to check repos.

As far as ntp. It was removed from Debian testing. Which Kali is based on.

https://tracker.debian.org/pkg/ntp
https://launchpad.net/debian/+source/ntp/+changelog

riverratt
2022-11-17, 06:42
I am having the exact same problem with a fresh kali 2022.3 live usb install direct from the kali iso image file.

──(kali㉿kali)-[~]
└─$ cat /etc/apt/sources.list
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib

┌──(kali㉿kali)-[~]
└─$ sudo apt-get update
Get:1 http://kali.download/kali kali-rolling InRelease [30.6 kB]
Reading package lists... Done
E: Release file for http://http.kali.org/kali/dists/kali-rolling/InRelease is not valid yet (invalid for another 2h 7min 56s). Updates for this repository will not be applied.


I have tried a variety of fixes but nothing works.

riverratt
2022-11-18, 05:40
I saw your post elsewhere and tried that already. Didnt work.

Update on my troubleshooting. I have reached this point----


┌──(kali㉿kali)-[/etc/apt]
└─$ apt-get update
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)

┌──(kali㉿kali)-[/etc/apt]
└─$ apt-get upgrade
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

┌──(kali㉿kali)-[/etc/apt]
└─$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

┌──(kali㉿kali)-[/etc/apt]
└─$ sudo apt-get update
Get:1 http://kali.download/kali kali-rolling InRelease [30.6 kB]
Reading package lists... Done
E: Release file for http://http.kali.org/kali/dists/kali-rolling/InRelease is not valid yet (invalid for another 3h 44min 44s). Updates for this repository will not be applied.

PhoenixRiver
2022-12-15, 10:41
use this command in terminal

timedatectl set-ntp on

This should fix all problems with clock and apt/

Abley
2023-03-07, 04:11
I am having the exact same problem with a fresh kali 2022.3 live usb install direct from the kali iso image file.

──(kali㉿kali)-[~]
└─$ cat /etc/apt/sources.list
deb http://http.kali.org/kali kali-rolling main non-free contrib
deb-src http://http.kali.org/kali kali-rolling main non-free contrib

┌──(kali㉿kali)-[~]
└─$ sudo apt-get update
Get:1 http://kali.download/kali kali-rolling InRelease [30.6 kB]
Reading package lists... Done
E: Release file for http://http.kali.org/kali/dists/kali-rolling/InRelease is not valid yet (invalid for another 2h 7min 56s). Updates for this repository will not be applied.


I have tried a variety of fixes but nothing works.







answer:-simply copy and paste this without the quotes
then edit the values to manually configure your date ""date --set="7 mar 2023 4:53:00""

hopehope
2023-07-12, 18:37
I have the simplest solution here. This is what you should do
open settings and then date and time
untick the option for automatic Date and time
for time format select AM/PM
for Timezone select based on where you are and lastly manually input the present correct time in your area.

thats all