我被要求通过ntp同步ubuntu 20。通常我在这次任务中使用了系统时间同步。在这台电脑上,我做了timedatectrl,得到了:
$ timedatectl
Local time: Mon 2021-03-08 10:24:24 -05
Universal time: Mon 2021-03-08 15:24:24 UTC
RTC time: Mon 2021-03-08 13:23:56
Time zone: America/Bogota (-05, -0500)
System clock synchronized: no
NTP service: n/a
RTC in local TZ: no然后我看到ntp也被安装了(顺便说一句,这是ubuntu 20的默认设置吗?)所以我下载了systemd-timesyncd rpm,把它移到这台pc上,然后运行:
~$ sudo dpkg -i systemd-timesyncd_245.4-4ubuntu3_amd64.deb
dpkg: regarding systemd-timesyncd_245.4-4ubuntu3_amd64.deb containing systemd-timesyncd:
systemd-timesyncd conflicts with time-daemon
ntp provides time-daemon and is present and installed.
dpkg: error processing archive systemd-timesyncd_245.4-4ubuntu3_amd64.deb (--install):
conflicting packages - not installing systemd-timesyncd
Errors were encountered while processing:
systemd-timesyncd_245.4-4ubuntu3_amd64.deb冲突的包是ntp,所以我尝试删除它:
~$ sudo apt remove ntp
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 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
systemd-timesyncd
The following packages will be REMOVED:
ntp
The following NEW packages will be installed:
systemd-timesyncd
0 upgraded, 1 newly installed, 1 to remove and 256 not upgraded.
Need to get 28.1 kB of archives.
After this operation, 1,778 kB disk space will be freed.
Do you want to continue? [Y/n] y
Err:1 http://il.archive.ubuntu.com/ubuntu focal-updates/main amd64 systemd-timesyncd amd64 245.4-4ubuntu3.3
Temporary failure resolving 'il.archive.ubuntu.com'
E: Failed to fetch http://il.archive.ubuntu.com/ubuntu/pool/main/s/systemd/systemd-timesyncd_245.4-4ubuntu3.3_amd64.deb Temporary failure resolving 'il.archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?将删除下列软件包: ntp将安装以下新包: systemd-timesyncd
但由于没有互联网连接,所以无法下载并安装,然后退出。
知道怎么处理这事吗?
发布于 2021-03-09 08:36:53
我下载了systemd-timesyncd_245.4-4ubuntu3.3_amd64.deb,把它移到了/var/cache/apt/archives/ ran apt remove ntp -y
一切都好了
https://askubuntu.com/questions/1322042
复制相似问题