Friday, February 1, 2019

Kali apt-get fail (404 not found), apt-get update fail (not valid yet), Fix=old date


In Kali I was trying to install packages but kept getting this error

root@kali:~# apt-get install libssh-dev
Reading package lists... Done
Building dependency tree     
Reading state information... Done
The following packages were automatically installed and are no longer required:
  libgnutls-dane0 libunbound2
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
  libssh-4 zlib1g-dev
Suggested packages:
  libssh-doc
The following NEW packages will be installed:
  libssh-dev zlib1g-dev
The following packages will be upgraded:
  libssh-4
1 upgraded, 2 newly installed, 0 to remove and 1472 not upgraded.
Need to get 435 kB/649 kB of archives.
After this operation, 1,651 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Err:1 http://http.kali.org/kali kali-rolling/main amd64 libssh-4 amd64 0.8.5-1
  404  Not Found [IP: 192.99.200.113 80]
Err:2 http://http.kali.org/kali kali-rolling/main amd64 libssh-dev amd64 0.8.5-1
  404  Not Found [IP: 192.99.200.113 80]
E: Failed to fetch http://http.kali.org/kali/pool/main/libs/libssh/libssh-4_0.8.5-1_amd64.deb  404  Not Found [IP: 192.99.200.113 80]
E: Failed to fetch http://http.kali.org/kali/pool/main/libs/libssh/libssh-dev_0.8.5-1_amd64.deb  404  Not Found [IP: 192.99.200.113 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

When I tried the update I got this error

root@kali:~# apt-get update
Get:1 http://kali.download/kali kali-rolling InRelease [30.5 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 41d 16h 53min 30s). Updates for this repository will not be applied.

When I ran date I realized is was many days behind

root@kali:~# date

The fix was to install ntpdate and run it

root@kali:~# apt-get install ntpdate
root@kali:~# ntpdate in.pool.ntp.org

Now my date was correct

root@kali:~# date

And now my installs worked

root@kali:~# apt-get install libssh-dev

2 comments: