首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在没有互联网连接的情况下删除ntp?

如何在没有互联网连接的情况下删除ntp?
EN

Ask Ubuntu用户
提问于 2021-03-08 13:39:03
回答 1查看 903关注 0票数 0

我被要求通过ntp同步ubuntu 20。通常我在这次任务中使用了系统时间同步。在这台电脑上,我做了timedatectrl,得到了:

代码语言:javascript
复制
$ 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上,然后运行:

代码语言:javascript
复制
~$ 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,所以我尝试删除它:

代码语言:javascript
复制
~$ 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

但由于没有互联网连接,所以无法下载并安装,然后退出。

知道怎么处理这事吗?

EN

回答 1

Ask Ubuntu用户

发布于 2021-03-09 08:36:53

我下载了systemd-timesyncd_245.4-4ubuntu3.3_amd64.deb,把它移到了/var/cache/apt/archives/ ran apt remove ntp -y

一切都好了

票数 0
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/1322042

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档