Saturday, 5 February 2011

upgrade - a simple Debian package script

While Ubuntu and variants have a good package upgrade mechanism, I find that this little script can sometimes help when these fail.

echo "Sources:\n"
grep '^deb ' /etc/apt/sources.list
sudo apt-get --fix-missing --list-cleanup update
sudo apt-get dist-upgrade
sudo apt-get -f check
sudo apt-get autoclean
sudo apt-get autoremove
sudo deborphan -Pz
This script has the following dependencies:

deborphan sudo apt
To install, use:

install -p -m 755 -o root upgrade /sbin/upgrade
Occasionally, run this to check for redundant packages:

deborphan --guess-all -Pz
And run this to clean local repository:

apt-get clean
One finally problem may be reported by gnupg about package authentication keys. To fix this, follow this example. I followed the example described here.
I recently updated this script to include the following:

sudo dpkg --configure -a
This is to complete installation of unpacked but unconfigured packages.

No comments: