Written 6 Sep 2026. This is a how-to, not a product card.
Replace the CMOS battery on the old PC
Every unplug resets the clock, or Restore AC won't stick. Swap the coin CMOS battery on the board. Skip a new PSU tonight.
Clock wrong while the cord stays plugged in? Start with software first: when the computer's clock is wrong. Lights came back and the house is messy? That checklist is after the power comes back. This note is only the coin battery on the motherboard that keeps Setup and the clock when wall power is gone.
Skip until settings die without wall power
If the clock only drifts a few minutes while the PC stays on, use network time — not a new battery. If Restore AC still holds after you unplug overnight, leave the case closed. Buy a CR2032 when the year snaps back to 2019 after every cord pull, or when Power On After Power Loss keeps reverting to Stay Off.
What this is
A flat coin cell (almost always a CR2032) sits in a small holder on the board. It powers a tiny bit of memory that holds the clock and Setup lines while the PSU is off. After five to ten years on a Marketplace OptiPlex or EliteDesk, that cell dies. Linux NTP can heal the clock each boot if the cord stays in. It cannot keep Restore AC, boot order, or the clock across a real unplug. One new cell usually fixes that. You don't need a new power supply for this symptom.
Step 1: confirm it is the battery
Two cheap checks before you open the case:
- Unplug the wall cord for ten minutes (or overnight). Plug back in. If the year is wrong again, or Setup lost a change you saved, the cell is a prime suspect.
- From SSH while it is running:
dateandtimedatectl. If NTP is on and the clock is fine until the next unplug, that is classic dead CMOS, not a broken internet path.
Still only wrong while powered? Stay on the software walk: when the computer's clock is wrong.
Step 2: shut down and unplug
From SSH or the keyboard:
sudo shutdown -h now
Wait until fans stop. Unplug the wall cord. Press the front power button once with the cord out to drain leftover charge. That polite stop is shut down without yanking the plug. Don't work inside with the cord still in.
Step 3: open the side panel
On most OptiPlex / EliteDesk / ThinkCentre towers, one or two thumbscrews free the side (or a latch). Lay the case on a clear table. Touch the metal chassis before you touch the board so you are not the spark. You only need enough room to see the coin cell. Skip taking the motherboard out.
Step 4: find the coin cell and note the polarity
Look for a silver disc about the size of a US nickel in a plastic or metal clip. Labels nearby may say BATTERY, CMOS, or BT1. Note which face is up: the side with writing (usually +) faces up on almost every board. Take a phone photo before you pop it. If the holder is empty already, someone removed it — buy a CR2032 and seat it the same way neighboring photos online show for your model.
Step 5: swap in a fresh CR2032
Press the metal retainer clip gently and slide the old cell out (or lift the hinged cover). Drop the new CR2032 in the same orientation. It should sit flat and feel clipped, not loose. One cell is enough. Don't stack two. Don't force a different size (CR2025 is thinner and often falls out).
Street price is a few dollars for a name-brand CR2032 at a pharmacy or big-box store. Skip "CMOS battery kits" with tools you don't need.
Step 6: close up, power on, re-set Setup
Panel back on. Cord in. Power on. The first boot after a dead cell often acts like a CMOS clear: you may see a "settings lost" or "press F1 / F2" prompt. Open Setup and put back what you care about:
- Restore AC / Power On After Power Loss → Power On (or Last State). Full walk: turn the old PC back on after a power blip.
- Boot order if you changed it for USB installs.
- Wake-on-LAN only if you already use it: wake the computer from the house network.
Save and exit. Let Ubuntu or Debian boot as usual.
Step 7: fix the clock in software, then prove the battery
SSH in. Turn network time on and set the house zone if needed:
sudo timedatectl set-ntp true
date
Full clock recovery if the year is still wild: when the computer's clock is wrong. Zone only: set the computer clock to your house.
Then prove the hardware: shut down cleanly, unplug for ten minutes, plug back in, boot. Setup changes should still be there. date should be close (NTP will finish the minutes). If the year is 2019 again, re-check that the cell is seated and is a real CR2032 — a dead pack from a junk drawer fails the same way.
What this is not
This is not a new PSU, a new motherboard, or a UPS. It is not the software-only clock fix while the cord stays in. It is not a reason to buy a GPS NTP hat. It is not opening the PSU itself. Leave the power supply closed.
What next
Clock still wrong with power on? When the computer's clock is wrong. Want button-free boots after a blink? Turn the old PC back on after a power blip. House messy after lights flicker? After the power comes back. Still skipping a battery box for the wall outlet? You don't need a UPS yet.
Optional: jot that you swapped the CR2032 (and re-set Restore AC) in Lab plan — username + passkey, no email. Skip if you just want to keep reading.
Skip
- Skip a new PSU or motherboard for a dead coin cell.
- Skip a GPS clock hat or NTP appliance.
- Skip working inside with the wall cord plugged in.
- Skip a different coin size when the holder says CR2032.
- Skip this if the clock only drifts while the PC stays powered — use the software clock note first.
- Skip vacuuming or blowing hard at the holder; a soft brush is enough if dust is in the way.
Sources
Dell support manuals (search your OptiPlex for CMOS / coin-cell battery). HP support (EliteDesk / ProDesk CMOS battery). Debian: timedatectl. Official pages only. Board layouts vary; match the holder on your chassis. For the software clock fix, see when the computer's clock is wrong. For Restore AC after a clear, see turn the old PC back on after a power blip.