Upgrading debian wheezy to jessie

Debian jessie is now officially released. So it's time to upgrade my home server (used as NAS and for development)

I've no concerns regarding dev tools exept of Docker that is an installation from backport. I have to made some configuration backup to track unexpected changes that may apply due switching to Systemd

Furthermore I cannot tolerate any loss of data. Well i'm using software RAID and data is stored on separate discs. The core system is not running on raid, my root partition is mounted to dedicated SSD. Anyway, all very important data are backed up now. And to some degree not important data too.

But anyway i want' to have assurance and control if possible by having not much effort.

Backup your configs

Let' backup system configuration we might need to check after upgrade.

# Installed packet status
dpkg --get-selections "*" > /.../BACKUP/wheezey/dpkg_selections.txt  
# Copy current /etc config to
cp -a /etc /...BACKUP/wheezey/  
# and more packet information
cp -a /var/lib/aptitude/ /.../BACKUP/wheezey/  
cp -a /var/lib/apt/ /.../BACKUP/wheezey/  
cp -a /var/lib/dpkg/ /.../BACKUP/wheezey/</code></pre>  

System checks

It's a good idea to check whether there are some problems with kernel modules. Do quick check if there are errors using dmesg
You may want'to see the list of loaded modules as well cat /proc/modules.

If you use aptitude make sure that there are no outstanding tasks. Start aptitude in interactive mode and hit "g". You also have to make sure that there are no packages "on hold" otherwise it will prevent the system to be upgraded. Besides this aptitude and apt-get uses it's own systems to maintain that.

aptitude search "~ahold"  

The apt apt-get maintained "hold" packages:

dpkg --get-selections | grep 'hold'  

Now check dpkg problems with

dpkg --audit  

If it shows nothing - everything is fine for now.

But there is maybe more to do. As already mentioned by default jessie will replace init-skripts with systemd by default (and i want give it a try). To minimize the amount of problems, i want to be sure that my current configuration of the services is clean. During the lifetime of my system i've installed and removed a lot of packages, now it's time to make sure that there is no unused configuration leftovers in particular unused init scripts.

#Displays a list of all removed packages that may have configuration files left on the system
$dpkg -l | awk '/^rc/ { print $2 }'
#Alternatively it's easier with aptitude
$aptitude search '~c'

Now purge all found unused packets

$aptitude purge '~c'

However i'd like to see if there are some manual changes on init.d scripts

dpkg-query --show -f'${Conffiles}' | sed 's, /,\n/,g' | \  
  grep /etc/init.d | awk 'NF,OFS=&quot;  &quot; {print $2, $1}' | \
  md5sum --quiet -c

This check says me that my /etc/init.d/docker script was modified. During the upgrade the systemd unit file for docker will take precedence to my locally modified init script... So now i know that i have to pay attention on this later.

Upgrading apt source-list

Ok, it seems that system is prepared for update in generall.

Now let's switch release codenames from wheezy to jessie.

sed -i 's/wheezy/jessie/g' /etc/apt/sources.list  
#Check cat /etc/apt/sources.list
#
# deb cdrom:[Debian GNU/Linux testing _Wheezy_ - Official Snapshot amd64 NETINST Binary-1 20120204-15:35]/ jessie main
#deb cdrom:[Debian GNU/Linux testing _Wheezy_ - Official Snapshot amd64 NETINST Binary-1 20120204-15:35]/ jessie main

deb http://ftp.de.debian.org/debian/ jessie main non-free contrib  
deb-src http://ftp.de.debian.org/debian/ jessie main non-free contrib

deb http://security.debian.org/ jessie/updates main contrib non-free  
deb-src http://security.debian.org/ jessie/updates main contrib non-free

#backports
deb http://ftp.debian.org/debian/ jessie-backports main non-free contrib  

As you see in the output i have also a backport source (now switcvhet do jessie-backports)
Hmmm, it would mean you would get backport from next testing version, but i don' want, so i disable it for now.

Be aware there could be more custom source lists in /etc/apt/sources.list.d/ I have to files more:

docker.list  nodesource.list  
# cat /etc/apt/sources.list.d/docker.list
deb https://get.docker.com/ubuntu docker main  
# cat /etc/apt/sources.list.d/nodesource.list
deb https://deb.nodesource.com/node wheezy main  
deb-src https://deb.nodesource.com/node wheezy main  

The first gives me the latest docker, the latest is the repository for Node.js.
Hmm.. The jessie docker.io package is to old for me. In case of docker i need really stick to the newest versions. So the source list stays like it is.
But nodesource needs to be jessie now:

sed -i 's/wheezy/jessie/g' /etc/apt/sources.list.d/nodesource.list  

Huh! now it seems that everything is ready! Now Double checking of source lists and start!

Do upgrade

First the list of available packages for the new release needs to be fetched.

apt-get update  

If no problems appeared run

apt-get upgrade  

to perform a minimal system upgrade (no packages will be removed at this stage)
Everything went smooth. Now finally we do a dist-upgrade.

apt-get dist-upgrade  

Both last steps may take i while... And during this you maybe will be asked about configuration changes. Actually if any files under /etc/ directory should be replaced by the package maintainer's version...
Well what to answer? Answering “yes” ensures system consistency. And you can always revert or merge the version, since they will be automatically saved with a .dpkg-old extension.

Rebooting

Now we have installed debian 8 jessie at least on disk, but we still running wheezy. We need to reboot. Before reboot you can again purge packets which where removed during the dist-upgrade.

$aptitude purge '~c'

Also check config files that where conflicting during the installation.

Restart...

init 6  

After Reboot checks

Hey it uses less ram now... Due systemd it started much faster...
Now check your services and start reading systemd manual ;)

Hope that this helps somebody.