#1142727 apt update reports exit code 0 when running out of disk space

Package:
apt
Source:
apt
Description:
commandline package manager
Submitter:
Michael Prokop
Date:
2026-07-24 16:23:04 UTC
Severity:
normal
#1142727#5
Date:
2026-07-24 16:14:34 UTC
From:
To:
Hi,

if a system ran out of disk space, executing `apt update` starts
with an actual error message (good!), then also only *warns* about
it. But in the end returns with exit code 0:

| user@gitlab ~ % sudo apt update
| [...]
| Get:2 https://security.debian.org/debian-security trixie-security InRelease [43.4 kB]
| Err:2 https://security.debian.org/debian-security trixie-security InRelease
|   Error writing to file - write (28: No space left on device) [IP: 151.101.194.132 443]
| [...]
| All packages are up to date.
| [...]
| Warning: Failed to fetch https://security.debian.org/debian-security/dists/trixie-security/InRelease  Error writing to file - write (28: No space left on device) [IP: 151.101.194.132 443]
| Warning: Failed to fetch https://packages.gitlab.com/gitlab/gitlab-ce/debian/dists/trixie/InRelease  Error writing to file - write (28: No space left on device) [IP: 172.64.148.245 443]
| Warning: Some index files failed to download. They have been ignored, or old ones used instead.
| user@gitlab ~ % echo $?
| 0
| user@gitlab ~ %

This might leave systems end up in an unpatched state (as security
updates also don't get applied, I have seen several such systems
just recently).

regards
-mika-