How to View Changelog for Installed Debian/Ubuntu Packages Without Original .deb File


2 views

When working with Debian-based systems, I often need to check package changelogs for version history, bug fixes, or security updates. However, the typical approach of dpkg -I package.deb becomes useless when you don't have the original .deb file.

The simplest solution is using the apt-get utility with the changelog option:

sudo apt-get install apt-show-versions
apt-get changelog packagename

For example, to check the changes in the latest nginx update:

apt-get changelog nginx

Debian packages store changelog information in /usr/share/doc/ directory. Try:

zless /usr/share/doc/packagename/changelog.Debian.gz

For example, to view the changelog for the openssh package:

zless /usr/share/doc/openssh-server/changelog.Debian.gz

Another approach is using the apt-show-versions tool with regex pattern matching:

sudo apt-get install apt-show-versions
apt-show-versions -a -p packagename

If local methods fail, query the Debian or Ubuntu package repositories directly:

curl -s http://changelogs.ubuntu.com/changelogs/pool/main/p/packagename/ | grep changelog

For example:

curl -s http://changelogs.ubuntu.com/changelogs/pool/main/a/apt/ | grep changelog

Some packages like kernel or snap applications might require different approaches. For kernel packages try:

apt-get changelog linux-image-$(uname -r)

In Debian/Ubuntu systems, package changelogs typically exist in three possible locations:

/usr/share/doc/<package>/changelog.Debian.gz
/usr/share/doc/<package>/changelog.gz
/usr/share/doc/<package>/NEWS.Debian.gz

The most reliable method to view changelogs for installed packages:

zless /usr/share/doc/<package>/changelog.Debian.gz
# Or for alternative locations:
zcat /usr/share/doc/<package>/changelog.gz | less

First identify the exact package name:

dpkg-query -l | grep partial-package-name
# Then view changelog:
dpkg-query --changelog package-name

For packages in repositories (even if not installed):

apt-get changelog package-name
# This works by downloading the changelog from the repo

Add this to your ~/.bashrc for quick access:

alias pkgchangelog='function _pkgchangelog(){ zless /usr/share/doc/$1/changelog.Debian.gz; };_pkgchangelog'

Looking at nginx changelog:

# First check installed version
dpkg -l nginx

# Then view changelog
zless /usr/share/doc/nginx/changelog.Debian.gz

# Alternative method
apt-get changelog nginx

Some packages don't include changelogs. In these cases:

# Check if changelog exists
ls /usr/share/doc/<package>/*changelog*

# Try downloading package info
apt-get download --print-uris <package>
# Then manually inspect the .deb file with:
dpkg-deb -I package.deb

For scripting purposes, you can extract specific version info:

# Get changes for specific version
zcat /usr/share/doc/<package>/changelog.Debian.gz | \
awk '/^<package>.*/ {p=0} /^<package> (1:)?1.2.3/ {p=1} p'