Upgrading unstable machines safely
Posted by Steve on Wed 17 Nov 2004 at 14:48
The apt system has hooks built in which allow you to run commands before and after a package upgrade.
These hooks aren't widely used, but two tools certainly make use of them: apt-listchanges shows you the the package changelogs before upgrading, and apt-listbugs show bugs currently reported against packages about to be installed.
The second package is the most often neglected, essentially it queries the Debian Bug Tracking System for reports listed against the packages you are going to install.
This allows you to see important, or grave bugs which might have been reported by people who upgraded before you. If you see a bug which looks serious you can read the discussion and then decide whether you wish to proceed with the upgrade.
For example the following is output I saw this morning when running apt-get upgrade:
Reading package fields... Done Reading package status... Done Retrieving bug reports... Done grave bugs of nvidia-kernel-source (1.0.6629-1 -> 1.0.6629+1-1) #267359 - nvidia-kernel-source: X Windows hard locks (requires hard restart) #267799 - fails to auto-load kernel module Summary: nvidia-kernel-source(2 bugs) Are you sure you want to install/upgrade the above packages? [Y/n/?/...]
Examining the discussion in the two bugs I decided to upgrade anyway. apt-listchanges is a similar idea to apt-listbugs, it shows you information relating to the packages you're about to upgrade, in this case it shows you the changelog of the Debian package.
All Debian packages install a 'changelog' file beneath /usr/share/doc/$packageName, usually called changelog.Debian (compressed it would be changelog.Debian.gz.
(To read a compressed file you can either enable to filters and use less, or run "zcat changelog.Debian.gz | more".)
The Debian changelog can contain useful information such as the number of bugs fixed since the last revision of the package, or notes on new releases.
Both of these packages can prevent you from being suprised by sudden breakages, and upgrade safely.
I've heard of FreeBSD's portaudit stuff and it's so nice Debian has something, too. Thank you!
Here's another scriptie that will pull the changelog off the site:
and yet another, that will show which package a file belongs to (like dpkg -S does for installed packages), or the list of files in a package (like dpkg -L does):
Here's another scriptie that will pull the changelog off the site:
#!/bin/bash
[ -z "$1" ] && echo "usage: $0 " 1>&2 && exit 1
v=$(apt-cache --no-all-versions -f show "$1" | grep -E '^Version:' | cut -d' ' -f2)
v=${v#*:}
fd=$(dirname $(apt-cache --no-all-versions -f show "$1" | grep -E '^Filename:' | cut -d' ' -f2))
fb=$(basename "$fd")
u="http://packages.debian.org/changelogs/$fd/${fb}_$v/changelog.txt"
echo "$u" >&2
wget -O- -q "$u" | ${PAGER:-less -F}
and yet another, that will show which package a file belongs to (like dpkg -S does for installed packages), or the list of files in a package (like dpkg -L does):
#!/bin/bash
[ -z "$1" ] && echo -ne "\t$0 \n\t$0 :list\n" >&2 && exit 1
word="$1"
searchmode='searchfiles'
case "$1" in
*:list) word="${word%%:list}"; searchmode='filelist';;
esac
wget -q -O- 'http://packages.debian.org/cgi-bin/search_contents.pl?version=tes ting&arch=i386&case=insensitive&word='"$word"'&searchmode='"$searchmode" | html2text -nobs | sed -nr '/^FILE\b/,$p;' | head -n-1
[ Parent | Reply to this comment ]