我正在尝试安装 systemd-timesyncdapt install systemd-timesyncd
并检索到 404 错误。
➜ ~ apt install systemd-timesyncd
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libevent-core-2.1-7 libevent-pthreads-2.1-7 libopts25 sntp
Use 'apt autoremove' to remove them.
The following NEW packages will be installed:
systemd-timesyncd
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 28.0 kB of archives.
After this operation, 243 kB of additional disk space will be used.
Err:1 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 systemd-timesyncd amd64 245.4-4ubuntu3.2
404 Not Found [IP: 91.189.88.142 80]
E: Failed to fetch http://archive.ubuntu.com/ubuntu/pool/main/s/systemd/systemd-timesyncd_245.4-4ubuntu3.2_amd64.deb 404 Not Found [IP: 91.189.88.142 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
有人能帮助我吗?
编辑
/ apt update
Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease
Get:2 http://archive.ubuntu.com/ubuntu focal-updates InRelease [114 kB]
Get:3 http://archive.ubuntu.com/ubuntu focal-security InRelease [114 kB]
Reading package lists... Done
E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal/InRelease is not valid yet (invalid for another 370d 10h 17min 57s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-updates/InRelease is not valid yet (invalid for another 998d 2h 18min 54s). Updates for this repository will not be applied.
E: Release file for http://archive.ubuntu.com/ubuntu/dists/focal-security/InRelease is not valid yet (invalid for another 998d 2h 18min 20s). Updates for this repository will not be applied.
➜ / date
Fri Apr 19 09:15:17 CEST 2019
➜ / timedatectl status
Local time: Fri 2019-04-19 09:15:27 CEST
Universal time: Fri 2019-04-19 07:15:27 UTC
RTC time: n/a
Time zone: Europe/Madrid (CEST, +0200)
System clock synchronized: no
NTP service: n/a
RTC in local TZ: no
➜ / sudo hwclock --hctosys --verbose
hwclock from util-linux 2.34
System Time: 1555659408.378273
Trying to open: /dev/rtc0
Trying to open: /dev/rtc
Trying to open: /dev/misc/rtc
No usable clock interface found.
hwclock: Cannot access the Hardware Clock via any known method.
答案1
这似乎是你的系统时间的问题。你的系统冻结时,存储库无效。看看这个回答服务器故障:
该问题似乎与有关
clocksource
,请检查available_clocksource
:$ cat /sys/devices/system/clocksource/clocksource0/available_clocksource tsc hpet acpi_pm
基于回答“clocksource tsc stable 是什么意思?” 看起来像TSC(时间戳计数器)不太可靠。
通过更新,
/etc/default/grub
您可以切换到另一个可用的时钟源。我正在使用高压聚酯。GRUB_CMDLINE_LINUX_DEFAULT="clocksource=hpet"
并更新 grub:
update-grub2
重启后
hwclock
再次工作(不做任何修改就重启也可能有帮助 - 可能只是时间问题)。笔记:最佳时钟源可能取决于您的主板和 CPU 型号。
因此,请按照以下步骤纠正你的时间:
使用文本编辑器以 root 身份进行编辑
/etc/default/grub
(例如sudo gedit /etc/default/grub
:-)找到该线
GRUB_CMDLINE_LINUX_DEFAULT=""
。将该行改为如下形式:
GRUB_CMDLINE_LINUX_DEFAULT="clocksource=hpet"
更新 grub:
sudo update-grub
重启确认:
sudo reboot
现在再次更新:
sudo apt update
安装软件包:
sudo apt install systemd-timesyncd