Thursday, 21 May 2026

 

Copilot , my CMOS battery inside my UBUNTU 26.04 Laptop is out of order so much so that the battery cannot retain the correct date and time when i boot up my UBUNTU 26.04 Laptop ......... Copilot , is there a Linux command that i can set or configure for my UBUNTU 26.04 Laptop so that when i boot up my UBUNTU 26.04 Laptop , my UBUNTU 26.04 Laptop WILL SHOW THE CORRECT DATE AND TIME WHEN I BOOT UP MY UBUNTU 26.04 LAPTOP

 

 

 

 

Since your CMOS battery is dead, your laptop can’t keep track of the date and time when powered off. Luckily, Ubuntu (and most Linux distros) can automatically sync the correct time from the internet at boot using NTP (Network Time Protocol). Here’s how you can set it up:

🛠️ Steps to Auto-Sync Time on Boot

  1. Check if systemd-timesyncd is installed (it usually is by default):

    timedatectl status
    
    • Look for System clock synchronized: yes and NTP service: active.
  2. Enable automatic time sync:

    sudo timedatectl set-ntp true
    

    This tells Ubuntu to always sync time from online servers when you boot.

  3. Verify it works:

    timedatectl
    

    You should see the correct time after connecting to the internet.

  4. Optional: Install ntp package (for more advanced syncing):

    sudo apt update
    sudo apt install ntp
    

    This runs a background service that keeps your clock accurate continuously.

⚡ Important Notes

  • You must have an internet connection at boot for this to work.
  • Without persistence (if you’re still on a live USB), these settings may reset each reboot. On a full installation, they’ll stick permanently.
  • Replacing the CMOS battery is the long-term fix, but NTP sync is a perfectly fine workaround.

So, you don’t have to replace the CMOS battery immediately — Ubuntu can correct the time automatically as long as you enable NTP sync.

Would you like me to walk you through configuring timedatectl step by step, or show you how to set up the more robust NTP service?

No comments:

Post a Comment