2

I just ran apt-get upgrade on my system, and as part of the installation (which includes many hundreds of packages), apt-listchanges brought up some text document. Unfortunately, I dismissed it before reading it, and now - I don't know what the maintainer wanted to tell me, nor which package it relates to ! :-(

Is there a way I could bring up that changelog / notifications document, again?

Notes:

  • You may assume I've not used apt again since this happened.
  • I'm using Devuan GNU/Linux Exaclibur, although that should probably not matter. apt version is: 2.9.33devuan1
2
  • You don’t mean the informations from less /var/log/apt/history.log and less /var/log/apt/term.log right? What is your distro? Commented Apr 3 at 23:04
  • @ReflectYourCharacter: No, that's the text I'm looking for; distro is Devuan, see edit. Commented Apr 4 at 8:32

1 Answer 1

2

To see exactly the same information as displayed by apt-listchanges, you’d have to look through the apt history in /var/log/apt/history.log to list the packages that were upgraded, then look for corresponding NEWS.Debian.gz and changelog.Debian.gz entries. Since you’re interested in the last upgrade performed through apt, look for the most recent “Upgrade:” line in history.log (the one closest to the top). This will list packages and the versions upgraded from and to; you can then look for corresponding entries in the changelogs. For example,

$ grep -m 1 '^Upgrade:' /var/log/apt/history.log
Upgrade: tzdata:amd64 (2024b-0+deb12u1, 2025b-0+deb12u1), libsystemd0:amd64 (252.33-1~deb12u1, 252.36-1~deb12u1), libudev1:amd64 (252.33-1~deb12u1, 252.36-1~deb12u1), libc6:amd64 (2.36-9+deb12u9, 2.36-9+deb12u10), base-files:amd64 (12.4+deb12u9, 12.4+deb12u10), libc-bin:amd64 (2.36-9+deb12u9, 2.36-9+deb12u10)

$ zcat /usr/share/doc/tzdata/changelog.Debian.gz | awk '/2025b-0\+deb12u1/,/2024b-0\+deb12u1/' | head -n -1

There are a few subtleties here. You need to trim the architecture from each package name; ideally you’d also want to deduplicate binary packages based on source packages (above, libc6 and libc-bin share the same changelog). The from and to versions need to be inverted, and any characters with special meaning in regular expressions need to be escaped. This approach doesn’t necessarily work with NEWS.Debian.gz either: those files don’t have entries for every single version, so you need to match the versions with entries against the version range by doing an explicit version comparison.

Without going into that amount of detail, if you know approximately when you upgraded, you can find the corresponding files by date and look at the recent entries there (at the top of each file). For example, to see notices upgraded in the last two days:

find /usr/share/doc -name NEWS.Debian.gz -ctime -3 -exec less {} +

The equivalent command for changelogs is

find /usr/share/doc -name changelog.Debian.gz -ctime -3 -exec less {} +

Both commands run less on a number of files; to view each file you need to move to the next one with :n instead of quitting less.

(Note that -mtime isn’t useful here because the last modification time is set to match the timestamp stored in the package, so it will always be older than the date and time at which the system was upgraded.)

If your system is capable of sending email directly, you can configure apt-listchanges to send its output by email as well as displaying it on-screen during the upgrade; this would avoid such problems in the future.

8
  • So, first, these two commands are a bit problematic, since after quitting the less, find gives up on showing me the rest of the files. Regardless of that - I'm getting hundreds of these files - because the apt-get upgrade upgraded hundreds of packages. I'll edit that into the question. Commented Apr 4 at 8:38
  • Are you quitting less after the first file? less is given a list of files to show, you need to move to the next file with :n instead of quitting. If you prefer quitting between files, replace + with \; in the commands; but then you won’t be able to quit early. I’m surprised that you’re seeing hundreds of NEWS.Debian.gz files, that would imply that you hadn’t upgraded for years. Seeing many changelog.Debian.gz files is normal given the circumstances, but you’d see hundreds of changelogs in apt-listchanges too — it doesn’t summarise changes for you. Commented Apr 4 at 8:52
  • The major difference with apt-listchanges is that the latter trims entries you’ve already seen from previous upgrades. But the important changes are supposed to go in NEWS.Debian.gz, and reading through those shouldn’t be too complicated even without apt-listchanges’ trimming. Commented Apr 4 at 8:53
  • 1
    @ReflectYourCharacter in this context it doesn’t add any more information compared to the apt logs, and would be more difficult to interpret (since large apt operations are implemented with several dpkg operations). Commented Apr 4 at 9:57
  • 1
    @ReflectYourCharacter --simulate starts from the current system state, and can’t be given an older state to simulate from, so unfortunately that doesn’t help since the current system state is post-upgrade. It should be possible to rebuild the apt stream that would be sent to apt-listchanges --apt, but even that wouldn’t help because the package files themselves are probably no longer available (since apt cleans /var/cache/apt by default). Commented Apr 4 at 10:29

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.