Stretch upgrade

Unfortunately, I started this documentation only after I upgraded 2 of my 3 main machines, so it is probably lacking.

Process

Similar to Koumbit's process, but we don't use Puppet:

Pre-upgrade checks:

sudo ttyrec -e screen /var/log/upgrade-stretch.ttyrec
cd /etc; git tag pre-stretch
git gc --prune # make /etc smaller for backup
tar cfz /var/backups/pre-stretch-backup.tgz /etc /var/lib/dpkg /var/lib/apt/extended_states /var/lib/aptitude/pkgstates
dpkg --get-selections "*" > /var/backups/dpkg-selections-pre-stretch.txt
rm /etc/apt/preferences /etc/apt/preferences.d/* #  Check for pinned (on hold) packages, and possibly disable
rm /etc/apt/sources.list.d/testing.list # or other similar backports or sources from later releases
rm /etc/apt/sources.list.d/jessie-backports.list
apt-mark showhold
dpkg --audit
apt update && apt -y upgrade
dpkg -l '*dkms' # look for dkms packages and make sure they are relevant, if not, purge.

Check free space, see this guide to free up space and download packages:

sed -i.orig 's/jessie/stretch/g' /etc/apt/sources.list
apt update; apt -o APT::Get::Trivial-Only=true dist-upgrade; df -h
apt -y -d upgrade && apt -y -d dist-upgrade

Actual upgrade run:

export DEBIAN_FRONTEND=noninteractive APT_LISTCHANGES_FRONTEND=mail
apt upgrade -y -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold'
apt dist-upgrade -y -o Dpkg::Options::='--force-confdef' -o Dpkg::Options::='--force-confold'
/opt/bin/clean_conflicts

Post-upgrade:

apt-get purge $(deborphan -n) # look also for obsolete packages in aptitude
dpkg -l '*-dbg' # look for dbg package and possible replace with -dbgsym
aptitude purge ~c # purge removed packages
apt autoremove -y --purge
apt-get clean
reboot
# review and purge older kernel once the new one boots properly

User-specific tasks:

Issues

References

Created . Edited .