When you look for the cause of an incident, you sometimes must ask “when and why did this library change?” The apt upgrade screen does not answer this. Basic APT commands show only the current state. The answer is spread across local logs, changelogs, Launchpad, and the Snapshot service.
This post tracks package changes in four steps: past, present, pending, and cause. The examples use Ubuntu 24.04 and 26.04.1.
When did it change on my server?
APT logs record changes per transaction. dpkg logs record changes per package.
$ zcat /var/log/apt/history.log.1.gz | tail -4
Start-Date: 2026-10-30 17:30:43
Commandline: /usr/bin/unattended-upgrade
Upgrade: libbrotli1:amd64 (1.1.0-2build2, 1.1.0-2ubuntu0.1)
End-Date: 2026-10-30 17:30:49
$ zgrep -h ' upgrade openssl:' /var/log/dpkg.log* | sort
2026-08-10 16:59:39 upgrade openssl:amd64 3.0.13-0ubuntu3 3.0.13-0ubuntu3.12
2026-08-27 06:20:15 upgrade openssl:amd64 3.0.13-0ubuntu3.12 3.0.13-0ubuntu3.15
2026-10-04 06:38:00 upgrade openssl:amd64 3.0.13-0ubuntu3.15 3.0.13-0ubuntu3.16
| Log | Content | Use |
|---|---|---|
/var/log/apt/history.log* | Command, requester, and packages of each transaction | Find who changed what, and with which command |
/var/log/apt/term.log* | Terminal output during installation (readable only by the adm group) | Find postinst errors |
/var/log/dpkg.log* | State changes of each package | Find when a specific package changed |
/var/log/unattended-upgrades/ | Runs of automatic updates | Check whether an update was applied automatically |
$ zcat -f /var/log/apt/history.log* | grep -E '^(Commandline|Requested-By)' | cut -d: -f1 | sort | uniq -c
264 Commandline
41 Requested-By
Requested-By appears only for transactions that ran with sudo. On this server, 41 of 264 transactions have it. The others include automatic runs such as unattended-upgrade above.
Which version is installed, and where is it from?
$ apt-cache policy openssl
openssl:
Installed: 3.0.13-0ubuntu3.16
Candidate: 3.0.13-0ubuntu3.16
Version table:
*** 3.0.13-0ubuntu3.16 500
500 http://kr.archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages
100 /var/lib/dpkg/status
3.0.13-0ubuntu3 500
500 http://kr.archive.ubuntu.com/ubuntu noble/main amd64 Packages
$ apt list -a openssl 2>/dev/null
Listing...
openssl/noble-updates,noble-security,now 3.0.13-0ubuntu3.16 amd64 [installed,automatic]
openssl/noble 3.0.13-0ubuntu3 amd64
The noble release pocket holds the version that shipped with the release. The -security and -updates pockets hold later updates. Archive mirrors keep only the latest version in each pocket, so .12 and .15 are not in the list.
Why did it change: the changelog
$ apt-get changelog openssl 2>/dev/null | head -8
Get:1 https://changelogs.ubuntu.com openssl 3.0.13-0ubuntu3.16 Changelog [156 kB]
openssl (3.0.13-0ubuntu3.16) noble-security; urgency=medium
* SECURITY UPDATE: Excessive Memory Allocation in Relative CRLDP Processing
- debian/patches/CVE-2026-35189.patch: Defer computation of relative CRLDP
names in crypto/x509/v3_crld.c, crypto/x509/v3_purp.c,
crypto/x509/x509_vfy.c, include/crypto/x509.h.
- CVE-2026-35189
apt-get changelog downloads the changelog over HTTPS. Minimal images do not include ca-certificates, so the command ends with no content.
# ubuntu-base rootfs without ca-certificates
$ apt-get changelog curl
Ign:1 https://changelogs.ubuntu.com curl 8.18.0-1ubuntu2.8 Changelog
See what will change before an upgrade
For each upgradable package, this script prints the pocket and the CVEs in the new changelog entries. It reads only the entries newer than the installed version.
#!/usr/bin/env bash
# Print the pocket, version change, and CVEs in new changelog entries of pending upgrades
set -uo pipefail
apt list --upgradable 2>/dev/null | tail -n +2 | while IFS= read -r line; do
pkg=${line%%/*}
pocket=$(cut -d/ -f2 <<<"$line" | cut -d' ' -f1)
new=$(awk '{print $2}' <<<"$line")
old=$(dpkg-query -W -f='${Version}' "$pkg" 2>/dev/null)
cves=$(apt-get changelog "$pkg" 2>/dev/null | {
while IFS= read -r l; do
if [[ $l =~ ^[a-z0-9.+-]+\ \(([^\)]+)\) ]]; then
# Binary and source epochs can differ, so compare without the epoch
dpkg --compare-versions "${BASH_REMATCH[1]#*:}" le "${old#*:}" && break
fi
printf '%s\n' "$l"
done; } | grep -oE 'CVE-[0-9]+-[0-9]+' | sort -u | paste -sd, -)
printf '%-14s %-34s %s -> %s %s\n' "$pkg" "$pocket" "$old" "$new" "${cves:--}"
doneOn 26.04.1, 20 of the 29 upgradable packages show CVE numbers. The output below is an excerpt without the long lines.
$ sudo apt-get update -qq && apt-changes
diffutils resolute-updates,resolute-security 1:3.12-1 -> 1:3.12-1ubuntu0.1 CVE-2026-53910
gnu-coreutils resolute-updates,resolute-security 9.7-3ubuntu2 -> 9.7-3ubuntu2.1 CVE-2025-5278,CVE-2026-56391
gpgv resolute-updates,resolute-security 2.4.8-4ubuntu3 -> 2.4.8-4ubuntu3.1 CVE-2026-57062
libattr1 resolute-updates,resolute-security 1:2.5.2-4 -> 1:2.5.2-4ubuntu0.1 CVE-2026-54371
libbz2-1.0 resolute-updates,resolute-security 1.0.8-6build2 -> 1.0.8-6ubuntu0.1 CVE-2026-42250
libgcrypt20 resolute-updates,resolute-security 1.12.0-2ubuntu1 -> 1.12.0-2ubuntu1.1 CVE-2024-2236
libaudit1 resolute-updates 1:4.1.2-1build1 -> 1:4.1.2-1ubuntu0.1 -
liblzma5 resolute-updates,resolute-security 5.8.3-1 -> 5.8.3-1ubuntu0.1 -
rust-coreutils resolute-updates 0.8.0-0ubuntu3 -> 0.10.0-1ubuntu2~26.04.1 -
- means “no CVE number found”, not “not a security fix”. If a package is in -security, as liblzma5 is, treat it as a security update.
When was it published: Launchpad
Use the Launchpad API to get the full publishing history, including superseded versions that mirrors no longer carry.
#!/usr/bin/env python3
# Print the publishing history of a package in a series: lp-history openssl noble
import json, sys, urllib.parse, urllib.request
pkg, series = sys.argv[1], sys.argv[2]
query = urllib.parse.urlencode({
"ws.op": "getPublishedSources",
"source_name": pkg,
"exact_match": "true",
"distro_series": f"https://api.launchpad.net/devel/ubuntu/{series}",
"order_by_date": "true",
"ws.size": 8,
})
url = f"https://api.launchpad.net/devel/ubuntu/+archive/primary?{query}"
for e in json.load(urllib.request.urlopen(url))["entries"]:
print(e["date_published"][:10], e["source_package_version"], e["pocket"], e["status"])$ lp-history openssl noble
2026-09-29 3.0.13-0ubuntu3.16 Updates Published
2026-09-29 3.0.13-0ubuntu3.16 Security Published
2026-08-25 3.0.13-0ubuntu3.15 Updates Superseded
2026-08-25 3.0.13-0ubuntu3.15 Security Superseded
2026-08-12 3.0.13-0ubuntu3.13 Proposed Deleted
2026-08-06 3.0.13-0ubuntu3.10 Proposed Superseded
2026-07-30 3.0.13-0ubuntu3.12 Updates Superseded
2026-07-30 3.0.13-0ubuntu3.12 Security Superseded
.16 was published on September 29. The dpkg log above shows that this server installed it on October 4. The difference between the two dates is the patch latency.
Is a specific CVE fixed?
$ pro fix CVE-2026-35189 --dry-run
CVE-2026-35189: OpenSSL vulnerabilities
- https://ubuntu.com/security/CVE-2026-35189
2 affected source packages are installed: edk2, openssl
(1/2) edk2:
Ubuntu security engineers are investigating this issue.
(2/2) openssl:
A fix is available in Ubuntu standard updates.
The update is already installed.
1 package is still affected: edk2
✘ CVE-2026-35189 is not resolved.
openssl is fixed, but edk2 is still affected. The openssl changelog alone does not show this.
View the archive at a point in time: Snapshot
The Snapshot service shows the archive as it was at a given time. APT in Ubuntu 24.04 and later supports it without extra repository settings.
$ sudo apt update --snapshot 20260601T000000Z
$ apt-cache policy curl --snapshot 20260601T000000Z | sed -n 1,6p
curl:
Installed: (none)
Candidate: 8.18.0-1ubuntu2.1
Version table:
8.18.0-1ubuntu2.1 500
500 https://snapshot.ubuntu.com/ubuntu/20260601T000000Z resolute-updates/main amd64 Packages
# Without --snapshot, the current candidate appears
$ apt-cache policy curl | sed -n 3p
Candidate: 8.18.0-1ubuntu2.8
Compare the candidate version at different times to find when a problematic version entered the archive. The commands below are simulations and install nothing.
$ apt-get -s install curl --update --snapshot 20260601T000000Z | grep '^Inst curl'
Inst curl (8.18.0-1ubuntu2.1 Ubuntu:26.04/resolute-updates, Ubuntu:26.04/resolute-security [amd64])
$ apt-get -s install curl --update --snapshot 20261001T000000Z | grep '^Inst curl'
Inst curl (8.18.0-1ubuntu2.7 Ubuntu:26.04/resolute-updates, Ubuntu:26.04/resolute-security [amd64])
$ apt-get update -qq && apt-get -s install curl | grep '^Inst curl'
Inst curl (8.18.0-1ubuntu2.8 Ubuntu:26.04/resolute-updates, Ubuntu:26.04/resolute-security [amd64])
To pin the whole system to one snapshot, add an APT configuration file. Use this to keep the same package versions on staging and production servers.
APT::Snapshot "20260601T000000Z";$ sudo apt-get update -qq
$ apt-cache policy curl | sed -n 3p
Candidate: 8.18.0-1ubuntu2.1
$ apt-get -s upgrade | tail -1
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Cautions
| Instruction | Reason |
|---|---|
Do not leave 50snapshot in place after you finish | The system gets no security patches after the pinned time. In the output above, upgrade found 0 packages. unattended-upgrades uses the same setting |
| Keep a separate copy of the logs if you need old history | The logrotate settings for the apt and dpkg logs are monthly and rotate 12 |
| Do not judge by the first changelog entry only | One upgrade can span several changelog entries. apt-changes reads all entries down to the installed version |
| Do not compare versions as strings | A no-change rebuild version (2.7.14build2) can be missing from the changelog. An exact match then collects the CVEs of the full history. Use dpkg --compare-versions |
| Do not compare the epoch of the binary version and the changelog version directly | bsdutils is 1:2.41.3, but the source version has no epoch, so the comparison stopped at the first line |
Check for phasing in the apt-cache policy output | Phased updates roll out to a subset of systems first. If servers show different candidate versions, check this first. None of the 156 upgradable packages was phased here, so the output does not show it |
Conclusion
| Question | Tool |
|---|---|
| When did it change on my server? | zgrep ' upgrade PACKAGE:' /var/log/dpkg.log* |
| Who changed it, and with which command? | /var/log/apt/history.log* |
| Where is the current version from? | apt-cache policy, apt list -a |
| Why did it change? | apt-get changelog |
| When was it published? | Launchpad getPublishedSources |
| Is the CVE fixed? | pro fix CVE-... --dry-run |
| What did the repository look like at that time? | apt update --snapshot |
To find running processes that still use old versions of updated libraries, use needrestart.