I'm currently have both Lenny and Squeeze installations.

I want to know how to:

  • list of all packages which are upgradable
  • know their current and future package numbers
  • have the changes (ChangeLog) for all of them between current/future version numbers
  • without actually upgrading anything

As a plus, I'd get this information without super user rights.

When I do aptitude update && aptitude upgrade I only see the packages; when I've installed apt-listchanges I only see them once I commited to installed them (yes, I know I can abort it).

Maybe I do not yet want to download all of the packages (could be a lot of them), which means I'd have to fetch the ChangeLog from somewhere else (but this is not a requirement; downloading them would fit too, but would require super user rights).


A deleted answers mentioned to take a look at apt-listchanges. Despite sounding redundant given my question, it's true that I didn't realize I can use apt-listchanges alone. The man page mentions the option --apt but I fail to understand which pipeline I need to construct (and if it meets my goals).

Update 2

I figured that with apt-show-versions I get a nice output; it's just that the ChangeLog is missing:

$ apt-show-versions -u
apache2/squeeze upgradeable from 2.2.16-6+squeeze1 to 2.2.16-6+squeeze2
apache2-mpm-worker/squeeze upgradeable from 2.2.16-6+squeeze1 to 2.2.16-6+squeeze2
apache2-utils/squeeze upgradeable from 2.2.16-6+squeeze1 to 2.2.16-6+squeeze2
apache2.2-bin/squeeze upgradeable from 2.2.16-6+squeeze1 to 2.2.16-6+squeeze2
apache2.2-common/squeeze upgradeable from 2.2.16-6+squeeze1 to 2.2.16-6+squeeze2

Here is a draft of a bash/zsh script that prints everything you want. It works only for upgradable packages, not for any new package which is installed because of changed dependencies. It does not work correctly for security or stable updates. And if http://packages.debian.org/changelogs/ is not up-to-date (does not include the version to which could be updated), it prints all changelog entries. Another issue (or feature if you want) is, that it prints the entries per binary package, not per source-package. Therefore you probably get duplications. You see, there is much room for improvements. It needs the apt-show-versions installed.

FLAVOURS=(main contrib non-free)

apt-show-versions -u | while read PACKAGE A B FROM C TO ; do
         SOURCEPACKAGE=$(dpkg-query -W -f '${Source}' $PACKAGE)
         if expr match $SOURCEPACKAGE "lib.*" > /dev/null ; then
         echo Changelog for $PACKAGE from $FROM to $TO
         for i in $FLAVOURS ; do
                if wget -q "http://packages.debian.org/changelogs/pool/$i/$PREFIX/$SOURCEPACKAGE/current/changelog.txt" -O $TEMPFILE ; then
                    dpkg-parsechangelog --since "$FROM" --to "$TO" -l$TEMPFILE | sed -e "1,/Changes:/d"

If you do not need all the information in an automated way, you can use the user interface of aptitude. There you can see which packages can be upgraded and you get the corresponding changelog with the new entries highlighted by pressing C.

  • I know I can download them "somewhere", but I'm really seeking for a solution which automates all of this. I need a textual list I can safe somewhere, not working inside a tool and going through the data. – mark Mar 13 '12 at 10:55
  • As you wrote in your update 2 that you already can get the old and new package versions, "only" a script need to be written which gets and filters the corresponding changelog entries. For this, I included the url to the changelogs. – jofel Mar 13 '12 at 11:31
  • I've improved my answer by adding a script which should really answer your question. – jofel Mar 13 '12 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.