- How to stop Ubuntu from constantly synchronizing the time?
- 1 Answer 1
- How to stop automatic time update via terminal?
- 3 Answers 3
- How to remove ntp without internet connection?
- How to disable systemd-timesyncd (NTP service via systemd).
- How to check systemd-timesyncd is being used.
- How to disable systemd-timesyncd .
- How to re-enable systemd-timesyncd.
- Отключить синхронизацию сетевого времени в Ubuntu 16.04
- 3 ответа
How to stop Ubuntu from constantly synchronizing the time?
The problem is that after a couple of seconds it changes the time back to normal automatically. How can I stop that? I’m using Ubuntu 16.04.
I’m wondering if this has something to do with ntpd , the Netowrk Time Protocol Daemon that keeps the system clock sync’ed with internet servers. I’m not sure if it could be as simple as «apt-get remove»-ing ntpd, or if it’s a bit more complicated than that
1 Answer 1
From what I understand, the core functions of ntpd have been replaced with timesyncd and timedatectl in that version of Ubuntu, as outlined in the documentation found in the link below:
If you run the command timedatectl you’ll see data in the following format:
chris@loki:/$ timedatectl Local time: Wed 2016-11-30 11:18:42 GMT Universal time: Wed 2016-11-30 11:18:42 UTC RTC time: Wed 2016-11-30 11:18:40 Time zone: Europe/London (GMT, +0000) Network time on: yes NTP synchronized: no RTC in local TZ: no
I ran the following to disable NTP synchronization:
But I still wasn’t able to change the time, as below:
chris@loki:/$ sudo timedatectl set-time "2015-11-08 07:14:00" Failed to set time: Automatic time synchronization is enabled
I was only able to update this once I’d gone to Settings > Date & Time and disabled Network Time. Not sure where the config file is for that though to do via cli.
chris@loki:/$ timedatectl status Local time: Wed 2016-11-30 11:31:33 GMT Universal time: Wed 2016-11-30 11:31:33 UTC RTC time: Wed 2016-11-30 11:31:31 Time zone: Europe/London (GMT, +0000) Network time on: no NTP synchronized: no RTC in local TZ: no chris@loki:/$ sudo timedatectl set-time "2014-11-08 06:40:00" chris@loki:/$ timedatectl status Local time: Sat 2014-11-08 06:40:02 GMT Universal time: Sat 2014-11-08 06:40:02 UTC RTC time: Sat 2014-11-08 06:40:03 Time zone: Europe/London (GMT, +0000) Network time on: no NTP synchronized: no RTC in local TZ: no
How to stop automatic time update via terminal?
This question shows how to stop automatic time update (and switch to manual): How to stop automatic time update? I want to do this exact thing but I can only ssh onto my machine so I need to make this change through the terminal. Is there any way to do this?
@AizuddinZali I would say it isn’t — since he gets errors telling him that ntp.service isn’t loaded and sudo /etc/init.d/ntp stop doesn’t work — see comments on my answer
Right, I’m just wondering id there’s a way to change settings from terminal, or is there a file somewhere I need to change a line of? I tried ‘conf watch /’ while I changed the setting in the gui but it didn’t show anything (but changing some other settings did)
3 Answers 3
GNOME Automatic Date & Time doesn’t use the ntp service, installable via sudo apt-get install ntp . Therefore stopping or uninstalling the service doesn’t help.
Systemd timedatectl is used, therefore one command to switch off
and one command to switch on
or via timedatectl status
% timedatectl status Local time: Do 2015-10-08 18:17:17 CEST Universal time: Do 2015-10-08 16:17:17 UTC RTC time: Do 2015-10-08 16:17:17 Time zone: Europe/Berlin (CEST, +0200) NTP enabled: no NTP synchronized: yes RTC in local TZ: no DST active: yes Last DST change: DST began at So 2015-03-29 01:59:59 CET So 2015-03-29 03:00:00 CEST Next DST change: DST ends (the clock jumps one hour backwards) at So 2015-10-25 02:59:59 CEST So 2015-10-25 02:00:00 CET % timedatectl set-ntp 1 % timedatectl status Local time: Do 2015-10-08 18:17:35 CEST Universal time: Do 2015-10-08 16:17:35 UTC RTC time: Do 2015-10-08 16:17:35 Time zone: Europe/Berlin (CEST, +0200) NTP enabled: yes NTP synchronized: yes RTC in local TZ: no DST active: yes Last DST change: DST began at So 2015-03-29 01:59:59 CET So 2015-03-29 03:00:00 CEST Next DST change: DST ends (the clock jumps one hour backwards) at So 2015-10-25 02:59:59 CEST So 2015-10-25 02:00:00 CET
How to remove ntp without internet connection?
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
~$ 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 ?
How to disable systemd-timesyncd (NTP service via systemd).
Today, so many things depend on accurate time-keeping. Thus we don’t need to disable time sync usually, but sometimes — workaround to annoying GPSD bugs and so on — we need to disable it. In the past, it was common to use ntpd for time sync. Since systemd-216, the systemd-timesyncd is often used. This article provides you «how to check systemd-timesyncd is being used», «how to disable systemd-timesyncd » and «how to re-enable systemd-timesyncd «.
How to check systemd-timesyncd is being used.
systemctl status systemd-timesyncd
If systemd-timesyncd is being used for time synchronization, you can see «Active: active (running)» in the result like following screenshot. On the other hand, systemd-timesyncd is not used, you can see «Active: inactive (dead)» in the result like following screenshot.
How to disable systemd-timesyncd .
sudo systemctl stop systemd-timesyncd
sudo systemctl disable systemd-timesyncd
How to re-enable systemd-timesyncd.
sudo systemctl enable systemd-timesyncd
sudo systemctl start systemd-timesyncd
systemctl status systemd-timesyncd
Отключить синхронизацию сетевого времени в Ubuntu 16.04
Как включить синхронизацию времени в сети в Ubuntu 16.04? Как проверить / убедиться, что сетевая синхронизация времени отключена?
3 ответа
Эта команда поможет вам найти часовой пояс:
timedatectl status | grep "Time zone"
После получения часового пояса, проверьте статус Network Time on , Следующая команда поможет вам проверить, включена она или отключена:
timedatectl status Network time on: yes NTP synchronized: yes
Теперь проверьте доступные часовые пояса. используйте следующую команду
timedatectl list-timezones
Используйте эту команду, чтобы выбрать часовой пояс:
sudo timedatectl set-timezone America/New_York
Как только вы закончите с вышеуказанной командой, используйте следующую команду, чтобы включить или отключить сетевое время:
sudo timedatectl set-ntp on
У меня запущен ntpd, и в настройках времени / даты включена синхронизация:
$ ps -ef | grep ntp ntp 1643 1 0 11:20 ? 00:00:00 /usr/sbin/ntpd -p /var/run/ntpd.pid -g -u 121:129
Если вы НЕ хотите, чтобы это было включено, настройте конфигурацию вручную и удалите пакет ntpd из вашей системы.
Чтобы проверить, работает ли синхронизация времени, наберите
в командной строке. Он должен написать, насколько точны ваши часы, если они синхронизированы. Чтобы проверить, как это синхронизировано, попробуйте это
Чтобы увидеть, работает ли служба ntp, наберите
systemctl status ntp.service
Вы можете остановить это с
systemctl stop ntp.service
systemctl start ntp.service
Вы можете увидеть некоторые настройки для времени и даты в системных настройках. Как видно на картинке, вы можете отключить автоматическую дату и время. Это остановит вашу синхронизацию времени.
И, наконец, у вас есть настройки для синхронизации времени в