apt-get: "No space left on device" Installing Packages
By Kaveh Alemi·Latchkey
An apt-get operation failed because downloading or unpacking .deb files hit ENOSPC. The apt cache plus unpacked files outgrew the runner disk.
What this error means
Install fails with No space left on device during download or dpkg unpack. Clearing the apt cache or freeing other space lets it complete with no change to the package list.
shell
E: Failed to fetch ... No space left on device
dpkg: error processing archive (--unpack):
cannot copy extracted data: No space left on device
Common causes
Apt cache plus unpacked files exhaust the disk
Downloaded .deb archives and their unpacked contents can be large; on a near-full runner they push the disk over the edge.
Disk already heavily used by the build
Checkout, tooling, and prior steps may leave little headroom for an apt install.
Use --no-install-recommends to skip optional dependencies.
Remove large preinstalled SDKs you do not need.
Move the job to a larger-disk runner if installs are big.
How to prevent it
Run apt-get clean after installs in long jobs.
Prefer --no-install-recommends.
Right-size disk for package-heavy setup steps.
Frequently asked questions
What causes "apt-get out of disk"?
Downloaded .deb archives and their unpacked contents can be large; on a near-full runner they push the disk over the edge.
How do I fix apt-get out of disk?
Reclaim room, then install with cache cleanup.
Can Latchkey fix this automatically?
Yes. Latchkey runs your GitHub Actions on managed runners that detect this failure, apply the fix, and retry the job automatically - self-healing is on by default.