0

i was asked to sync ubuntu 20 via ntp. usually im using systemd-timesync for this mission. on this pc i did timedatectrl and got:

$ 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

then i see ntp is also installed (btw is this the default for ubuntu 20 now?) so i downloaded the systemd-timesyncd rpm moved it to this pc then run:

~$ 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

the conflicting package is ntp so i try to remove it:

~$ 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?

The following packages will be REMOVED: ntp The following NEW packages will be installed: systemd-timesyncd

but there is no internet connection so apt cant download and install systemd-timesyncd and then it exit.

any idea how to deal with this ?

  • Does this answer your question? [How can I install software or packages without Internet (offline)?](https://askubuntu.com/questions/974/how-can-i-install-software-or-packages-without-internet-offline) – Artur Meinild Mar 08 '21 at 13:43
  • its more about how to remove ntp while offline then how to offline install – David Shuhami Mar 08 '21 at 13:52
  • 2
    It's the installation of timesyncd that's your problem, not removal of ntp - the issue is that the two are inverse dependent of each other - timesyncd will not install before ntp is removed. So you need to install offline as well. – Artur Meinild Mar 08 '21 at 14:15
  • this the result of offline install: 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 – David Shuhami Mar 08 '21 at 16:24
  • can i force apt\dpkg to ignore the conflict ? can i fool apt and copy the deb into /var/cache/apt ? – David Shuhami Mar 08 '21 at 16:28
  • Does this answer your question? [Installing software when Internet not working](https://askubuntu.com/questions/1022924/installing-software-when-internet-not-working) – karel Mar 09 '21 at 08:39

1 Answers1

0

I downloaded systemd-timesyncd_245.4-4ubuntu3.3_amd64.deb,
moved it to /var/cache/apt/archives/
ran apt remove ntp -y

all good now

guntbert
  • 12,914
  • 37
  • 45
  • 86