Labthrift Labthrift What to buy. What to skip. Why.

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 seeLikely cause
Could not get lock / Waiting for cache lock / Unable to acquire the dpkg frontend lockAnother apt or unattended-upgrades is running. Step 2.
dpkg was interrupted / you must manually run dpkg --configure -aA previous upgrade stopped mid-way. Step 4.
No space left on device / Write error / Unpack failed for lack of spaceSystem disk is packed. Step 3.
Temporary failure resolving / Failed to fetch / 404 Not Found on a mirrorName lookup or mirror trouble. Step 5.
Held packages / packages have been kept backOften 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

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.

Also on this topic

Keep the computer updatedOnce a week, give the computer its fixes so SSH and Pi-hole are not sitting on last year's bugs. Skip this until next week if you just finished first weekend. See if a reboot is neededAfter weekly updates, check whether a reboot is needed before you buy a monitoring box. After a reboot, check the computer still does its jobsThe computer came back up. Confirm SSH, house ad block, and the file share still work before you buy anything. Let the computer apply weekly fixes without youAfter the weekly two-command habit is boring, you can let the computer apply those same fixes by itself. Skip this until that habit is boring. Don't let it reboot on its own. Clear old package downloads when the disk is tightAfter weekly updates, leftover downloads can sit on the disk. Clear them safely before you buy a bigger drive or a NAS. When the computer's disk is fullPhotos won't copy, the share says no space, or df shows the system disk packed. Confirm it is the computer (not the backup stick), free room or move the house folder. You don't need a NAS. Keep Pi-hole updatedWeekly apt does not refresh Pi-hole. Update the software and the block lists on the old PC so ads stay gone. You don't need a new Raspberry Pi. SSH from the couchType commands on the old PC from your laptop, on the house network. Password login first. Don't open this to the internet. When SSH won't connectSSH hangs, says connection refused, or Permission denied. Check the computer is on, confirm the address, then the user and password. You don't need a new router or a KVM.