矫正Kali Linux时间
在树莓派Zero W上运行Kali Linux之后,发现每次尝试更新系统都出现如下报错:
root@kali:~# apt update
Get:1 http://mirrors.neusoft.edu.cn/kali kali-rolling InRelease [30.5 kB]
Reading package lists... Done
W: http: aptMethod::Configuration: could not load seccomp policy: Invalid argument
W: http: aptMethod::Configuration: could not load seccomp policy: Invalid argument
E: Release file for http://http.kali.org/kali/dists/kali-rolling/InRelease is not valid yet (invalid for another 101d 9h 32min 36s). Updates for this repository will not be applied.可以看到提示信息中显示时间差异invalid for another 101d 9h 32min 36s,仔细检查系统时间可以看到,当前系统时钟还停留在2017年,而准确的当前时间是2018年:
root@kali:~# date
Thu Dec 21 14:36:31 UTC 2017矫正Kali Linux时钟
配置时区
BIOS时间设置local模式
编辑 /etc/timezone 设置
Asia/Shanghai硬件时钟
在树莓派上没有如何设置硬件时钟的方法(参考How to check if hardware clock is in UTC or Local time),使用
sudo hwclok --debug显示:
检查timedatectl显示输出
设置本地时间软链接
/etc/localtime 做软链接指向时区
矫正系统时间
此时检查时钟如下:
检查和设置时钟同步
检查
timesyncd服务
启动过
timesyncd
设置系统启动时启动时间同步(不过默认就是启动的)
完成时钟同步之后,再次使用apt update就不会报错了
参考
Last updated
Was this helpful?