System Administration & Network Administration
debian upgrade
Updated Thu, 18 Aug 2022 14:07:53 GMT

Debian 7 upgrade to 8 precautions and advice concerning packages

With Debian 8 soon going stable I'd like to upgrade my KVM on which I run the latest Debian 7.8.

I've never done this before and would appreciate any advice about some of the steps I'm not sure about:

  • I use dotdeb repo for PHP 5.6.
  • I compiled my own nginx 1.7 with make install
  • I use MariaDB repo for Wheezy

For the 2 added repos... Should I first apt-get remove these and also remove the sources list links for them?

My idea is, after Debian is updated to 8... I can add new repos tailored for it (or compile my own PHP) and they should pick up on existing config files.

Also, is it ok to leave the self compiled nginx when upgrading Debian? Compile again if necessary?

EDIT: Installation progress

Everything went smooth (at least to my knowledge). Here are my steps if anyone is interested.

  • Do the usual apt-get update and apt-get upgrade for wheezy
  • Change the /etc/apt/sources.list, replaced all wheezy words with jessie, removed dotdeb repo and included mariadb sid repo
  • run apt-get update and apt-get upgrade
  • after that run apt-get dist-upgrade
  • reboot

as per the official docs I also purged removed packages

apt-get purge $(dpkg -l | awk '/^rc/ { print $2 }')

Still need to do checks if there are any leftovers but the system and main services like PHP and Mariadb are working as usual.


For the most part it's painless as normal.

For the 'big move' it's best to have just the main repository of the version you are upgrading to. Remove any other repos including old ones of the same lineage.

You don't need to remove any packages from 'other' repositories, however, unless you pin them they may get upgraded. The configuration files are linked to packages not repositories so there's no problem there.

It's normally best to ensure that apt-get and dpkg are updated early.

Always CHECK before you let the apt-get dist-upgrade do it's stuff. Occasionally it'll get confused and decide it's best move is to remove large numbers of packages (annoying). If you manually install (upgrade) a few important packages first it'll normally get better. If you find it wants to remove half the system when you upgrade a particular package the best thing to try is something like:

apt-get install packageyouwanttoinstall packageyoudontwantremoved

Usually apt-get will then try something different.

One of the dangerous this this time is the replacement of init by systemd. You may want to put a rejection of systemd into your preferences file until the rest of the upgrade is done so this change can happen with all new initscripts.

Obviously, make sure you have backups before you try this and you know how to restore them!

Oh, and read the Release notes

To "reject systemd" you can add a section to your /etc/apt/preferences file. Though generally, you don't want anything in there during the upgrade and you should remove this afterwards. If you do this you will have to install systemd explicitly as it'll assume you have chosen no to do the switch.

Package: systemd
Pin: release o=debian
Pin-Priority: -1

Edit2: On a related note, I've just upgraded aother server from squeeze to jessie.

Rule one don't skip wheezy, it go so confused I ended up using my backups.

It's a more generic server so it had different packages; the samba, squid and apache2 packages are of note. Samba has been upgraded to V4, this will probably break a custom configuration, everything seems to still be there, just a little different. The Debian standards for Apache's configuration files have changed; if you don't upgrade all the config files it'll break; you should have followed the rules when you did your customisations. Once I moved them to the "right" files it was fine. If you haven't already upgraded to squid3 the old squid package doesn't exist in jessie you will continue to run happily on the wheezy version but you should upgrade to squid3 soon.

Oh, and udev whinged what the kernel was too old. (I forgot to reboot after upgrading to wheezy)

Comments (2)

  • +0 – Thanks. I definitely need to look into making a proper back up. I've been reading Debian's official upgrade pdf and noticed it now ships with PHP 5.6, so I'm guessing using the official repo and just removing dotdeb's would work... and changing MariaDB to sid I guess. Could you explain a bit further on the systemd rejection? Thanks — Apr 21, 2015 at 16:04  
  • +0 – I've updated my original post with the installation progress. — Apr 21, 2015 at 18:18  

External Links

External links referenced by this document: