Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Fix time in alpine linux
- ##################################################################
- Join our telegram channel for more : https://t.me/LinuxClassesEFXTv
- ##################################################################
- apk add chrony
- rc-service chronyd start
- rc-update add chronyd
- chronyc tracking
- date
- or
- Step 1: Install NTP client
- apk update
- apk add busybox-extras
- Step 2: Sync Time via NTP
- ntpd -d -q -n -p pool.ntp.org
- Optional: Set Time at Boot
- Since time resets every time you start the QEMU VM, you can add this sync command in your Alpine's startup script (/etc/local.d/ntp.start) if you want automatic time sync:
- #!/bin/sh
- ntpd -q -n -p pool.ntp.org
- If Manual Time Set is Needed (Fallback)
- If NTP fails for some reason (e.g., network issues), manually set it:
- date -s "2025-04-09 15:45:00"
- docker restart containerid # to get container (docker ps)
- # If you already followed above use command to sync
- ntpd -d -q -n -p pool.ntp.org
- or
- # Update repository
- nano /etc/apk/repositories
- or
- sed -i 's/https/http/' /etc/apk/repositories
- change https with http
- apk update;
- apk upgrade
- apk add ntp
- ntpd -qg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement