Written 5 Sep 2026. This is a how-to, not a product card.
When weekly updates won't install
apt says could not get lock, waiting for cache, or dpkg was interrupted. Wait out the other updater, free disk room, then finish the weekly fixes. You don't need a new mini PC.
Haven't done the calm weekly habit yet? That is keep the computer updated. This note is the failure case: you typed the two commands and apt refused, hung on a lock, or quit mid-install. Pi-hole's own updater is a different page: keep Pi-hole updated.
Skip until SSH works
You need a login on the computer from the couch: SSH from the couch. Connect fails? when SSH won't connect. Don't yank the power cord because an updater is slow. Don't buy a monitoring box for a lock file.
What this is
Ubuntu and Debian let only one package tool touch the system at a time. A weekly apt upgrade, the Software Updater GUI (rare on a server), or unattended-upgrades can hold the lock. A full disk can stop the install. A killed upgrade can leave dpkg half-finished. The walk below is wait and look first. Delete lock files only when you know nothing else is running.
Step 1: copy the exact error
Run the weekly pair again so the message is fresh:
sudo apt update
sudo apt upgrade
Match what you see:
| What you see | Likely cause |
|---|---|
| Could not get lock / Waiting for cache lock / Unable to acquire the dpkg frontend lock | Another apt or unattended-upgrades is running. Step 2. |
| dpkg was interrupted / you must manually run dpkg --configure -a | A previous upgrade stopped mid-way. Step 4. |
| No space left on device / Write error / Unpack failed for lack of space | System disk is packed. Step 3. |
| Temporary failure resolving / Failed to fetch / 404 Not Found on a mirror | Name lookup or mirror trouble. Step 5. |
| Held packages / packages have been kept back | Often fine for a week. Note it. Don't force a dist-upgrade on day one. |
Step 2: see who holds the lock
List apt-related processes:
ps aux | grep -E 'apt|dpkg|unattended' | grep -v grep
If you see apt-get, apt, dpkg, or unattended-upgrade, wait. Five to twenty minutes is normal on an old disk. Watch progress:
sudo tail -f /var/log/unattended-upgrades/unattended-upgrades.log
Press Ctrl-C when the log goes quiet or the process list is empty. Then retry sudo apt update and sudo apt upgrade.
Still locked with an empty process list after a few minutes? See the lock files without deleting them yet:
ls -l /var/lib/dpkg/lock* /var/lib/apt/lists/lock /var/cache/apt/archives/lock 2>/dev/null
Reboot is the gentle reset when you are sure nothing is installing:
sudo reboot
After it comes back, find it on the house network, SSH in, and run the two update commands again. Only if a lock file still blocks with no apt process, ask a friend who knows dpkg before you remove lock files by hand. Deleting the wrong lock while dpkg is mid-write can break the package database.
Step 3: rule out a full disk
Print human sizes:
df -h /
If Use% on / is 95โ100%, free room before you fight apt: when the computer's disk is full. Old package downloads are a cheap first cut: clear old package downloads when the disk is tight.
Step 4: finish an interrupted upgrade
When apt tells you to configure packages by hand:
sudo dpkg --configure -a
Then:
sudo apt -f install
sudo apt update
sudo apt upgrade
Say yes to prompts the same way you do on a quiet week. If it asks about restarting services, yes is fine on a house computer that is not a store.
Step 5: when names or mirrors fail
If apt update cannot resolve hosts, check that the computer still reaches the internet:
ping -c 3 1.1.1.1
Then try a name:
ping -c 3 archive.ubuntu.com
Numbers work but names fail? DNS on the computer is wrong. See see which name server the computer is using. Ads may also be back house-wide: when ads come back. A 404 on one package often clears after another sudo apt update. Skip editing sources.list on day one unless you know the mirror died for good.
Step 6: finish the week the normal way
When the lock is gone and the disk has room:
sudo apt update
sudo apt upgrade
Then check whether a reboot is needed: see if a reboot is needed. After a reboot, confirm SSH, ads, and the share: after a reboot, check the computer still does its jobs. Apt still does not refresh Pi-hole itself: keep Pi-hole updated.
What this is not
This is not a reason to reinstall Ubuntu. It is not rm on every lock file the first time you see the word lock. It is not turning on automatic reboot. It is not a new mini PC because one weekly upgrade waited on unattended-upgrades. It is not Pi-hole's pihole -up failure. That stays on keep Pi-hole updated.
What next
When the two commands are boring again, the calm habit is keep the computer updated. When that habit is dull, optional background fixes: let the computer apply weekly fixes without you (leave auto-reboot off). Disk still tight after a clean: when the computer's disk is full. Wrong clock can make mirrors look odd: set the computer clock to your house.
Skip
- Skip deleting lock files while
psstill shows apt or dpkg. - Skip yanking the power cord to "unstick" an upgrade.
- Skip
apt dist-upgradeor changing release pockets on day one. - Skip a new mini PC or a NAS for a lock message.
- Skip opening the package manager past the house network.
- Skip this if you have never run the weekly two commands. Start with the calm habit first.
Sources
Debian: apt. Ubuntu: apt. Debian: dpkg. Official pages only. For the calm weekly habit, see keep the computer updated. For the login, see SSH from the couch. For a packed disk, see when the computer's disk is full.