2

I get a problem when install ntp (offline install) because the conflict with time-daemon of systemd-timesyncd.

# dpkg -i ntp_4.2.8p12+dfsg-3ubuntu4.20.04.1_amd64.deb
dpkg: regarding ntp_4.2.8p12+dfsg-3ubuntu4.20.04.1_amd64.deb containing ntp:
 ntp conflicts with time-daemon
  systemd-timesyncd provides time-daemon and is present and installed.

dpkg: error processing archive ntp_4.2.8p12+dfsg-3ubuntu4.20.04.1_amd64.deb (--install): conflicting packages - not installing ntp Errors were encountered while processing: ntp_4.2.8p12+dfsg-3ubuntu4.20.04.1_amd64.deb

any suggest to fix this?

Tks

Quang Nguyen
  • 21
  • 1
  • 1
  • 3

4 Answers4

1

NOTE: It would probably be best to obtain a copy of systemd-timesyncd just in case you want to reinstall later.

If you don't have build-essential installed to compile from source as described by @Terrance in the comments, and if you want to remove systemd-timesyncd and install ntp you can use apt instead of dpkg to install the downloaded .deb file and handle the dependency/conflict automatically.

The only difference between dpkg and apt is that you need to use the full path to the downloaded file when using apt. Assuming the downloaded file is in your current directory, you would use:

apt install ./ntp_4.2.8p12+dfsg-3ubuntu4.20.04.1_amd64.deb

or

apt install "./ntp_4.2.8p12+dfsg-3ubuntu4.20.04.1_amd64.deb"
mchid
  • 44,904
  • 8
  • 102
  • 162
1

ERROR: The following packages have unmet dependencies: chrony: Conflicts: time-daemon ntp: Conflicts: time-daemon

Also face same error in PopOs/Ubuntu. I just ran this line (in terminal) and my problem solved.

sudo apt remove systemd-timesyncd
Kaiyom
  • 11
1

This fixed the problem for me:

sudo apt-get install --assume-yes ntpsec ntp 
0

Tks all for the help, i finally fix it:

  • Connect to internet, still can not install ntp
  • Using command 'apt --fix-broken install' as suggest --> it remove systemd-timesyncd and install ntp
Quang Nguyen
  • 21
  • 1
  • 1
  • 3