1

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

9
  • 2
    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.
    – Thomas Ward
    Oct 5, 2022 at 3:46
  • so i have to remove systemd-timesyncd, i try to do it but not success. ' Oct 5, 2022 at 3:54
  • 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?
    – mchid
    Oct 5, 2022 at 3:59
  • because the server not connect to internet Oct 5, 2022 at 4:01
  • 1
    that's right, the server is connected to NTP Server and i want to synchronize time to that NTP Server Oct 6, 2022 at 2:01

3 Answers 3

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
0
0

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"
6
  • 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 ``` Oct 5, 2022 at 10:07
  • 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 Oct 5, 2022 at 10:40
  • so i think the best way now is connect server to internet to update apt and install ntp? Oct 5, 2022 at 10:45
  • @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
    Oct 7, 2022 at 2:25
  • 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
    Oct 7, 2022 at 2:33
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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .