72

This question describes how to get the changelog for a given package. However, it's the whole changelog.

What I'd like is a way to see what will be changed in whatever I'm about to upgrade. For example, I was imagining something like:

$ sudo apt-get upgrade --show-changelogs
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  foo
    -- adds the bar feature for better snazziness
    -- removes the deprecated baz feature

1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 8,864 kB of archives.
After this operation, 285 kB disk space will be freed.
Do you want to continue [Y/n]? 

Unfortunately, I don't see anything like that in the man pages for apt-get. Does this or something similar exist?

UPDATE: I've written a short blog post talking about apt-listchanges and Debian changelogs in a little more depth that incorporates some of the feedback in this question.

Sri
  • 1,662
  • 2
  • 20
  • 39

5 Answers5

67

The nearest thing to what you are looking for can be had with a package called apt-listchanges, which will give you a changelog summary when you upgrade packages. You can set it up so the changelog notes appear in the terminal directly after apt-get downloads the upgrade (see below explanation and screenshot), but before you install it.

You can install the program with

sudo apt-get install apt-listchanges

and then set it up with

sudo dpkg-reconfigure apt-listchanges

The setup file created is /etc/apt/listchanges.conf.

My setup has the changelog information being shown directly as text in the terminal (stdout), which is just what you wanted. I find this is better than having a pager load up the information. I just have changelogs selected in my conf file, so the news about the package is not shown. I have also set it up to email root the excerpt of the changelog. You need to set up local email by referencing my article here if you want to use this feature.

This is my /etc/apt/listchanges.conf:

[apt]
frontend=text
email_address=root
confirm=1
save_seen=/var/lib/apt/listchanges.db
which=changelogs

A screenshot of the upgrade procedure when apt-listchanges is installed. I have set it to ask me for install confirmation after reading the changelog excerpt.

enter image description here

For more information see man apt-listchanges and the Ubuntu manpages online.

17

I use aptitude:

$ aptitude changelog package-name

See this question: apt changelog for to-be installed packages

Will
  • 301
  • 2
  • 5
  • 2
    Is this the same link the OP posted when he said he had taken a look at it but wanted something different? – Stefan van den Akker Jan 16 '15 at 08:49
  • 2
    This is the whole changelog for a single package -- what I wanted was just the changes in all the packages I'm about to upgrade. Doing aptitude changelog ... and visually parsing out the results would be very tedious, especially when more than a few packages change. – John Feminella May 24 '15 at 12:19
7
$ apt changelog firefox

Works for me. For external PPAs it fails, even though this one is at http://changelogs.ubuntu.com/changelogs/binary/p/plasma-framework/5.67.0-0ubuntu2/changelog

$ apt changelog plasma-framework
E: Ophalen van changelog:/plasma-framework.changelog is mislukt  Logbestand met veranderingen niet beschikbaar voor plasma-framework=5.67.0-0ubuntu2~ubuntu19.10~ppa1

Or more useful, via Synaptic:

This change is not coming from a source that supports changelogs.

Failed to fetch the changelog for plasma-framework
URI was: http://ppa.launchpad.net/pool/main/p/plasma-framework/plasma-framework_5.67.0-0ubuntu2~ubuntu19.10~ppa1_amd64.changelog

Which doesn't work:

E: ERROR: couldn't open /root/.synaptic/synaptic.conf for writing - ofstream (5: Input/output error)
E: An error occurred while saving configurations.
1

Prerequisite: install apt-listchanges:

sudo apt install apt-listchanges

Then the following oneliner will show the changelog diff between currently-installed and to-be-upgraded packages:

(cd $(mktemp -d) && apt download $(apt list -qq --upgradable | cut -f1 -d"/") && apt-listchanges *.deb)

This oneliner will first download the latest versions of .deb archives of the to-be-upgraded packages to a temporary directory. Then apt-listchanges is executed on these *.deb packages.

This onliner does not need admin/superuser/sudo rights.

Abdull
  • 502
0

You could do something like this

fullList=$(apt list --upgradable 2> /dev/null)
shortList=$(echo "${fullList}" | cut -f1 -d"/" | sed s/Listing...//)

for pkg in $shortList ; do echo "## ${pkg}" apt-get changelog ${pkg} done

Press q to read the changelog for each package ; if you redirect the output of the pager to a file, it will loop through the list until the end, albeit slowly.

yPhil
  • 1,557
  • 14
  • 25