Score:1

Could not install NTP because of conflicts with time-daemon (systemd-timesyncd) on Ubuntu 20.04 LTS

re flag

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

ru flag
You cannot have `systemd-timesyncd` and `ntp` (which provides the ntp daemon) installed simultaneously because they both use the ntp ports ande protocols. You need to pick one or the other, you can't have both.
Quang Nguyen avatar
re flag
so i have to remove systemd-timesyncd, i try to do it but not success. '
mchid avatar
bo flag
Why are you using `dpkg` to install a downloaded version of ntp instead of simply using `apt` to install the version from the official repository?
Quang Nguyen avatar
re flag
because the server not connect to internet
Terrance avatar
id flag
NTP recommends p15 version. Downloaded from https://support.ntp.org/Main/SoftwareDownloads or it links to https://doc.ntp.org/downloads/ and I have done it on my system that still has `systemd-timesyncd` installed on it. My instructions are for the p12 NTP, but they are the same installation steps but with p15 instead of p12. https://askubuntu.com/questions/1123106/how-to-update-to-latest-ntp-patch-4-2-8p12-on-ubuntu-18-04/1123111#1123111 I would definitely recommend doing it from source.
Quang Nguyen avatar
re flag
tks u sir, let me try it
Terrance avatar
id flag
If the server is not connected to the internet, how do you expect the time synchronization to work? Do you have another server that is connected to the internet or connected to satellite GPS that will provide the time sync? Both NTP and timesyncd require a connection to another server to sync.
Quang Nguyen avatar
re flag
that's right, the server is connected to NTP Server and i want to synchronize time to that NTP Server
Christian Ehrhardt avatar
sl flag
And in all the discussion how to install ntp offline, please do not forget that since 18.04 one should use chrony instead => https://wiki.ubuntu.com/BionicBeaver/ReleaseNotes#Chrony
Score:0
re flag

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
Score:0
sg flag

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
Score:0
bo flag

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"
Quang Nguyen avatar
re flag
i try to install ntp p15 but it's still not working ``` p# dpkg -i ntp_4.2.8p15+dfsg-1_amd64.deb dpkg: regarding ntp_4.2.8p15+dfsg-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.8p15+dfsg-1_amd64.deb (--install): conflicting packages - not installing ntp Errors were encountered while processing: ntp_4.2.8p15+dfsg-1_amd64.deb ```
Quang Nguyen avatar
re flag
Problem with apt install: `apt install /ntp_4.2.8p15+dfsg-1_amd64.deb You might want to run 'apt --fix-broken install' to correct these. The following packages have unmet dependencies: aptitude : Depends: aptitude-common (= 0.8.12-1ubuntu4) but it is not installed Depends: libboost-iostreams1.71.0 but it is not installed Depends: libsigc++-2.0-0v5 (>= 2.8.0) but it is not installed Depends: libxapian30 (>= 1.4.14~) but it is not installed Recommends: libparse-debianchangelog-perl but it is not installed `
Quang Nguyen avatar
re flag
so i think the best way now is connect server to internet to update apt and install ntp?
mchid avatar
bo flag
@QuangNguyen Yeah, that would be ideal if possible. If it's not possible to connect to the internet, you could download each of those packages into a single directory and then run `sudo apt install ./*.deb` or `sudo apt install "./*.deb"` and it should install all the packages at once. I guess it comes down to if it's easier to download each of those packages or easier to connect the server to the internet. Although, connecting the server to the internet does give you the opportunity to do upgrades (which can fix some bugs), install other packages, etc.
mchid avatar
bo flag
Of course, the other option would be to uninstall `systemd-timesyncd` using `dpkg -r systemd-timesyncd` None of the dependencies listed in your error message are related to `ntp` so theoretically, you should be able to uninstall `systemd-timesyncd` and install `ntp`, assuming there are no more dependencies tied to `systemd-timesyncd`.
mchid avatar
bo flag
And of course, just use `dpkg -i ntp_4.2.8p12+dfsg-3ubuntu4.20.04.1_amd64.deb` to install `ntp`.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.