The officially official Devuan Forum!

You are not logged in.

#1 2025-12-09 16:00:30

kapqa
Member
Registered: 2019-01-02
Posts: 575  

How set time to local-time in terminal?

Hello ,

i have set-up a Devuan 6 system with MATE Desktop;

now found out that the time is "1-hour-behind" due to computer probably aligned with greenwhich time or so.

now what i did previously was variously type in terminal like

"sudo ntpdate" or "sudo ntp" and the time would somehow set itself up to local-time.

now , however, both of tthese packages seem not present with devuan 7.

could you please show the proper method on aligning the time to local-time?

have already set the time in mate-desktop to local-location, but it seem not make-a-difference.

thank you very much.

Offline

#2 2025-12-09 16:17:02

greenjeans
Member
Registered: 2017-04-07
Posts: 1,344  
Website

Re: How set time to local-time in terminal?

dpkg-reconfigure tzdata

https://sourceforge.net/projects/vuu-do/ New Vuu-do isos uploaded October 2025!
Vuu-do GNU/Linux, minimal Devuan-based Openbox and Mate systems to build on. Also a max version for OB.
Devuan 5 mate-mini iso, pure Devuan, 100% no-vuu-do. wink Devuan 6 version also available for testing.
Please donate to support Devuan and init freedom! https://devuan.org/os/donate

Offline

#3 2025-12-09 16:59:37

Andre4freedom
Member
Registered: 2017-11-15
Posts: 241  

Re: How set time to local-time in terminal?

And to set ntp right, as you seem to refer to:
it's ntpsec to be installed.
And to check if it works:

ntpq -p

And in devuan 7 ??? These programs are present in Devuan 6 (Excalibur)
ntpdate was for older ditributions, like RedHat etc.

Offline

#4 2025-12-09 17:07:24

rolfie
Member
Registered: 2017-11-25
Posts: 1,383  

Re: How set time to local-time in terminal?

ntp and ntpdate are outdated since Daedalus. Look for ntpsec, e.g.

apt list ntpsec*

Online

#5 2025-12-09 17:07:24

chris2be8
Member
Registered: 2018-08-11
Posts: 358  

Re: How set time to local-time in terminal?

Typing which ntp and pressing tab twice will get you a list of programs in your path with names starting with ntp. man ntp and tab twice will get a similar list of man pages. This trick is worth remembering next time you are not sure what a program should be called.

Offline

#6 2025-12-09 17:17:44

kapqa
Member
Registered: 2019-01-02
Posts: 575  

Re: How set time to local-time in terminal?

sudo dpkg-reconfigure tzdata
[sudo] password for rich: 

Current default time zone: 'Europe/Rome'
Local time is now:      Tue Dec  9 17:16:46 CET 2025.
Universal Time is now:  Tue Dec  9 16:16:46 UTC 2025.

but the time is still ¹ hour behind.

EDIT

apt list ntpsec*
ntpsec-doc/stable,stable 1.2.3+dfsg1-8 all
ntpsec-ntpdate/stable,now 1.2.3+dfsg1-8 amd64 [installed]
ntpsec-ntpdate/stable 1.2.3+dfsg1-8 i386
ntpsec-ntpdig/stable,now 1.2.3+dfsg1-8 amd64 [installed,automatic]
ntpsec-ntpdig/stable 1.2.3+dfsg1-8 i386
ntpsec-ntpviz/stable 1.2.3+dfsg1-8 amd64
ntpsec-ntpviz/stable 1.2.3+dfsg1-8 i386
ntpsec/stable 1.2.3+dfsg1-8 amd64
ntpsec/stable 1.2.3+dfsg1-8 i386

sudo ntpsec-ntpdate
sudo: ntpsec-ntpdate: command not found

EDIT II

bash: ntpq: command not found

Last edited by kapqa (2025-12-09 17:22:34)

Offline

#7 2025-12-09 17:42:38

rolfie
Member
Registered: 2017-11-25
Posts: 1,383  

Re: How set time to local-time in terminal?

I fear it doesn't work that way, never did.

Best for a Linux system: set the HW clock in the Bios to UTC. Set the time zone to your region.

Then install the packages ntpsec and ntpsec-ntpdate.

Last but not least: define a time server in /etc/ntpsec/ntp.conf. Works for me.

Note: when you dual boot with Windows, you have to change the registry to also set Windows to UTC.

Last edited by rolfie (2025-12-09 19:47:41)

Online

#8 2025-12-09 19:26:57

Andre4freedom
Member
Registered: 2017-11-15
Posts: 241  

Re: How set time to local-time in terminal?

Sure, rolfie is right.
The computer's HW clock should be set to UTC. And the timezone (TZ) should be selected as to the standards.
When DST patterns change for some time-zones, the corresponding patches will be distributed. Another reason to update regularly.

Offline

#9 2025-12-09 21:30:15

RedGreen925
Member
Registered: 2024-12-07
Posts: 216  

Re: How set time to local-time in terminal?

Change it to local in /etc/adjtime to give you what you want.

https://wiki.debian.org/DateTime

Online

#10 Yesterday 11:31:37

bai4Iej2need
Member
From: Ortenau
Registered: 2021-04-25
Posts: 143  

Re: How set time to local-time in terminal?

see my thread https://dev1galaxy.org/viewtopic.php?id=7636

consider if you want every device in your intranet to blast its IPv6 address all over the internet.
consider economy of data and privacy .


The devil, you know, is better than the angel, you don't know. by a British Citizen, I don't know too good.
One generation abandons the enterprises of another like stranded vessels. By Henry David Thoreau, WALDEN, Economy. Line 236 (Gutenberg text Version)
broken by design :
https://bugs.debian.org/cgi-bin/bugrepo … bug=958390

Offline

#11 Yesterday 18:54:19

kapqa
Member
Registered: 2019-01-02
Posts: 575  

Re: How set time to local-time in terminal?

have a second parttition which is with KDE  and also there the time is wrong;

however, it seem that there is not option to correct it in the setting

(would like to set "set date and time automatically" but it is not selectable)

sudo apt install ntpsec
[sudo] password for rich: 
Installing:                     
  ntpsec

Installing dependencies:
  python3-ntp

Suggested packages:
  certbot  ntpsec-doc  ntpsec-ntpviz

REMOVING:
[b]  openntpd
[/b]
Summary:
  Upgrading: 0, Installing: 2, Removing: 1, Not Upgrading: 0
  Download size: 437 kB
  Space needed: 1,150 kB / 721 GB available

Continue? [Y/n] 

https://ibb.co/0NbTDLt

thanks, will check in BIPS BIOS and get back to you.
this computer is around a year aold , and first time got maybe around 6 -7 bios updates.
(probably have not the time set right last time after BIOS update=)

Offline

#12 Yesterday 22:20:58

GlennW
Member
From: Brisbane, Australia
Registered: 2019-07-18
Posts: 687  

Re: How set time to local-time in terminal?

I realise I am surfing the rim here, but...

system service hwclock allows changes to or from system time.

Set the Hardware Clock to the current System Time.
# hwclock --systohc

Set the System Time from the Hardware Clock.
# hwclock --hctosys

# hwclock --set --date="8:20:05"

But, generally I set the bios to UTC and the system takes care of the rest.

All the best.


pic from 1993, new guitar day.

Offline

Board footer