There is a new version of this tutorial available for Debian 10 (Buster).

How to upgrade Debian Wheezy to Jessie safely

This tutorial explains the upgrade procedure to upgrade Debian from Wheezy to Jessie in a few simple steps.

Before you start with the upgrade, backup all critical data. Thats especially the config data in the /etc directory and the user data in /home. When you run a server then you should include the databases (MySQL, Postgresql, etc), web and email data in the backup as well. The backup should be stored on a external harddisk, on an external server e.g. by FTP or on a cloud drive. Here are a few examples on how to create backups with tar.

Backup the configuration and data

Configuration files in the /etc directory.

tar -pczf etc.tar.gz /etc

Backup of the /var/www website directory.

tar -pczf www.tar.gz /var/www

Backup of the /home directories.

tar -pczf home.tar.gz /home

For ISPConfig 3 users: Backup of your email server files.

tar -pczf vmail.tar.gz /var/vmail

Backup MySQL databases

mysqldump --defaults-file=/etc/mysql/debian.cnf -cCeQ --hex-blob --quote-names --routines --events --triggers --all-databases -r all_databases.sql

Then move the tar.gz and .sql files for safe storage on a backup drive.


Check the apt sources.list file

We will install all available Wheezy updates first before we upgrade to Jessie. On some systems the package source is defined as "stable" in the sources.list file instead of "wheezy" or "jessie". To avoid an accidential early upgrade to Jessie, please check the sources.list now and ensure that it contains "wheezy" and not "stable" as source:

Use a commandline editor like nano or vi to open /etc/apt/sources.list, the lines should be similar to the ones below:

nano /etc/apt/sources.list
deb wheezy main contrib non-free
deb-src wheezy main contrib non-free
deb wheezy-updates main contrib non-free
deb wheezy/updates main contrib non-free

Your country code is most likely not "de", you should use the code of your country here. Using your country code in the file will speed up the package download.


Update the packages for Wheezy

The following commands will install all pending Wheezy updates. This ensures that your system is in a good shape for the update to Jessie.

apt-get update

Ready for first upgrade:

apt-get upgrade

Follow this with:

apt-get dist-upgrade


Check the package state to ensure that no packages are on hold or in half installed state

This test is important, we will check the package state to ensure that no packages are on hold or in half installed state. Your system and apt database must be in a good shape before we proceed with the dist upgrade. If there are any broken or "on hold" packages, then fix these issues before the upgrade.

Check that no packages are on hold by querying the package database with the dpkg command:

dpkg --audit
dpkg --get-selections | grep hold

When both commands did not return any packages, then proceed with the upgrade.


Update the sources.list for Jessie

Edit the /etc/apt/sources.list file again:

nano /etc/apt/sources.list

and replace its content with the following lines:

deb jessie main contrib non-free
deb-src jessie main contrib non-free

deb jessie-updates main contrib non-free deb-src jessie-updates main contrib non-free

deb jessie/updates main contrib non-free
deb-src jessie/updates main contrib non-free

Choose your nearest locale by replacing "de" with e.g. "us" or your country code. Then save the file and run the following command to update the sources database:

apt-get update


Jessie Upgrade in two steps

It is recommended to do the upgrade in two steps, first run "apt-get upgrade" to install the base packages and then run "apt-get dist-upgrade" to do the actual distribution upgrade,

Start with the update by running this command:

apt-get upgrade

Next we will do the distribution upgrade by running:

apt-get dist-upgrade

A reboot is required to finish the upgrade and load the new kernel:


Check the update

To check which Debian version is currently installed on the system, take a look at the file /etc/os-release.

cat /etc/os-release

The result on an Debian Jessie system is:

Share this page:

Suggested articles

50 Comment(s)

Add comment


By: David

Thank you very much, this is clear and efficient.

By: tothz

Thanks. It is nice, but how can I restore mysql database ?



By: till

Mysql gets just updated, all databases and users stay intact. so no need to restore them.

By: tothz

Yes, if the upgrade procedure works well.. :-)

but the question.. how can  I restore the dumped mysql database..

(mysqldump --defaults-file=/etc/mysql/debian.cnf -cCeQ --hex-blob --quote-names --routines --events --triggers --all-databases -r all_databases.sql )

sorry, my english is very poor



By: till

Mysql databases get imported with the MySQL command.

mysqldump --defaults-file=/etc/mysql/debian < all_databases.sql

The update does not remove any databases so you don't have to import them, the backup has been made to reinstall the server in case the update failed.

By: Babak

I used this procedure and was able to upgrade, Thanks for writting it.

My only suggestion to improve this is to start the computer with prompt only, without xwindows & desktop environment.

This way in the middle of process do not need to stop and start a new domain. 


By: fatmike

What about multicluster setup and mysql(5.5) replications.

Are they staying intact too?

Start with the master and after that upgrade the slaves?

By: nicheplayer

Dunno if you're monitoring this post much anymore, but I was running through these steps today trying to upgrade from 7 to 8 at my vps and got to this step:

apt-get dist-upgrade

when the upgrade process removed upstart and replaced it with sysvinit, then promptly failed. I wonder, since I have wheezy fully updated, if I can skip the upgrade step and go straight to modifying the sources.list to do the upgrade to 8?

By: till

You can try to skip this step and update from a not up to date wheezy system to Jessie, but I haven't tested that. But I wonder why you have upstart on Debian wheezy, Debian wheezy uses sysvinit and not upstart by default.

By: eelco de graaff


After the upgrade packages where left back. To make the update complete i needed to do a apt-get dist-upgrade


By: Pixelcone

I end up formatting my cloud and install jessie from scratch because of those apache error. Its a waste of time you should put a warning on that before upgrading to jessie

By: till

I upgraded quite a few servers of our customers from wheezy to Jessie, the updates were flawlessly. When your server is broken before or you don't have a clean setup, then you might encounter issues. So when your Wheezy system is broken or not cleanly installed, fix it before you update.

By: hmckelvey

Hello Pixelcone,



I have upgraded using these instructions and found that they worked in fact I upgraded all 32 of my Wheezy Kernels to Jessie. Then I wondered about your situation so I broke my Apache server (did a remove and a partial install by stopping the installation with a system crash) and tried to load from Wheezy to Jessie on the system with the broken server. This was what I found: The conversion from Wheezy to Jessie failed catastrophically, resulting in having to load Jessie on a by reloading Wheezy from noob and the upgrading and updating it, then upgrading to Jessie. The instructions are for a clean Wheezy system. Therefore, the information provided is sufficient, but there should be a warning stating that this has been tested and a clean Wheezy system is mandatory to upgrade to a Jessie system.

By: DebianUser

Debian includes instructions with the release notes to every stable release. For this particular case see this link .


This guide has incomplete backup instructions, for which I'm now dealing with the fallout of on a system I'm trying to rescue. For anyone else considering this guide, consider at least this part of the official instructions:



4.1.1. Back up any data or configuration information

Before upgrading your system, it is strongly recommended that you make a full backup, or at least back up any data or configuration information you can't afford to lose. The upgrade tools and process are quite reliable, but a hardware failure in the middle of an upgrade could result in a severely damaged system.

The main things you'll want to back up are the contents of /etc, /var/lib/dpkg, /var/lib/apt/extended_states and the output of dpkg --get-selections "*" (the quotes are important). If you use aptitude to manage packages on your system, you will also want to back up/var/lib/aptitude/pkgstates.

The upgrade process itself does not modify anything in the /home directory. However, some applications (e.g. parts of the Mozilla suite, and the GNOME and KDE desktop environments) are known to overwrite existing user settings with new defaults when a new version of the application is first started by a user. As a precaution, you may want to make a backup of the hidden files and directories (“dotfiles”) in users' home directories. This backup may help to restore or recreate the old settings. You may also want to inform users about this.

Any package installation operation must be run with superuser privileges, so either log in as root or use su or sudo to gain the necessary access rights.

The upgrade has a few preconditions; you should check them before actually executing the upgrade."


Also, be aware this guide may fail if you have any packages on hold or use APT pinning.

By: wohnungsrechner

all done. Thanks for this Tutorial. I made an snapshot of the system before, then i dont need to make manual backups... all works fine.

By: Keith

Worked for me as of 2016 May 8th.

Only issues after upgrade where with the usual Nvidia driver B.S. which I had previoulsy with the original Wheezy install.

Fixed those by installing the nvidia driver deb packages as per

Thank you for the guide it was most helpful.

By: Ryan hs

thank you! 

By: Chris

I had problems with dependencies that I couldn´t resolve, apache2 failed config etc.So I made the backups as discribed above. How can I use them to restore the system? I had to re-install the whole server. Would it destruct the system again, when I just pasted the etc folder? Thanks, and greetz.

By: florian2833z

E: Error, pkgProblemResolver::Resolve generated breaks, this may be caused by held packages.

Any help ?

By: Rassloff

thanks for sharing !!! works excellent !!!

By: Sang Kang

I didn't realize this but if you've upgraded your mysql and the update procedure did not use mysql_upgrade then it will break the r[email protected]'s permission to access certain table. I manually tried to fix this but made it worse. Since my server was used for VPN only, I just wiped out the php5/mysql and reinstalled it and that took care of the permission issue and was able to finish the update. I strongly encourage you to backup your mysql prior to running your update.

By: coriakin

i had key errors after first trying apt-get update (after new Jessie sources added) and found this solution worked after simple google search (i had to add multiple new keys before running apt-get).


By: Dave

Nice one worked for me.

By: Aerobaticrug

Worked a charm

By: Brandon McCaig

I appreciate the guide. I haven't attempted to upgrade a Linux distro in years and in the past it never seemed to work smoothly. My testing Web server was stuck on wheezy and I wanted to upgrade, but didn't want to go through the trouble of copying all of the data over the network and back again. It's not mission critical data; most of the data I care about is copied or tracked with version control, but some of it I would have to get over and start from scratch. In any case, I was nervous about starting an upgrade and having to go through the pains of reinstalling the system if it failed. It was freenode's notice of irssi being insecure today that prompted me to try to upgrade the distro itself. I could have gotten the source, but there was likely other software out of date that would benefit from a whole distribution upgrade. I'm sure wheezy is somewhat safe still since I think it's still supported by the security team, but it feels good to have an up-to-date system. I followed the guide and rebooted and aside from postgresql giving me some balls (which I wasn't using really anyway) I had no trouble. I ended up uninstalling the old postresql packages and installing 9.4 again afterward. Seemed to work fine. I'll figure that out if I ever get around to using it.

By: Remko Bolt

Sorry, but I would put it a bit more harsh than DebianUser, don't use this so called howto. Just go to and use the source.

By: Jason

Did you even try the tutorial or are you just a trolling here? The above tutorial works flawlessly, I updated 5 servers by using it without an issue.

By: Der Joesse

I did it with a Raspberry Pi (raspbian), and all went well.

By: Peter

Just performed the upgrade using these step by step guides. Worked like a charm - took some time to upgrade all the Plesk packages too though.

By: leo

Again, after another sucessful upgrade. Thank you very much, this is clear and efficient.

By: Gustavo Arnosti Neves

Hi, another successfull upgrade.

It is worth mentioning that people with SSD's should probably trim their partitions BEFORE and AFTER upgrading or they may run out of space.

In my case:

sudo fstrim -v /sudo fstrim -v /home

I have removed all PHP stuff drom dotweb and their repository. Then installed the default php packages.

Also removed all repos that where for Wheezy only (all except webmin in my case).

MariaDB was installed from their repo (which was removed before jessie upgrade). I was able to upgrade it with a simple apt-get install mariadb-server (after Jessie upgrade).

By: nilux17

Configuration file in /etc/apache2/sites-enabled/ must have a ".conf" extension, otherwise, apache won't start.

By: Stefan Dosdal

worked smoothly. thanks.

By: Fahad

I want to update my VPS from Putty, Debian to Jessie, How ?

By: rick

Thanks, this worked perfectly, exacly what I needed.

By: DeepSeaDiver

Excellent tutorial, very easy to follow and works like a charm.

Thanks so much

By: DeepSeaDiver

I would like to add that after successfully upgrading to Jessie, do a update-->upgrade-->dist-upgrade sequence again.


By: Azfar

Systems updated to wheezy safely but kernel is still on 3.2.0-4-amd64 instaed of 3.16.0-4-amd64!

By: till

Did you reboot after upgrade? If not, reboot now. If yes, check the grub boot loader config, maybe you defined there a specific kernel to be booted instead of the latest one.

By: Azfar

I am on EC2 HVM so had ot replace extlinux with grub in order to boot from newer kernels.

By: ken

Pretty handy for those of us who don't spend much time administering or upgrading linux. However; since I applied it to a laptop, a previously pretty stable system on wheezy has started locking its console shortly after login & while I'm using it and then blanking the screen!

By: David Newton

I am using a Dockstar with a flash drive to run debian Wheezy. After I followed this instruction and upgrade to Jessie and reboot, I could not ssh into it anymore. I checked the sshd_configure file which seems to be ok. Before reboot after upgrade, everything seems working fine. It seems to me that one possible reason is that sshd did not run after reboot. Please advise if there is any hint to fix this problem. I have to use another mechine to edit the configuration files when necessary since there is no way for this setup to connect to a monitor/keyboard. Thanks a lot.

By: Ninos

Hey there, is the upgrade from jessie to stretch as easy as wheezy to jessie? After dist-upgrade do I need to rerun ispconfig updater or something like that (may some change config files...)?

By: till

Probably yes, I've never had any real issues with a Debian upgrade. But I haven't tested it yet.

By: Ninos

Sorry for the new comment (not reply). Seems there's a technical bug on comments area.

About the upgrade from jessie to stretch: If a recreation of the config files is needed, how can I reconfigure my services? Is there a ispconfig script which can be run (like the updater script)? Also do I need to change some settings after upgrade, e.g. php-pathes in admin are...?


By: till

Just run the ISPConfig update script and choose to reconfigure services.

By: paka

 I've used this wonderful guide for the wheezy to jessie upgrade.  That's saying qute a bit as I absoultly dread OS upgrades on the server.

Now considering upgrading from jessie to stretch.  However was unable to locate a similar guide.

Are the steps similar enough so that I need only edit in the new stretch repository locations?

By: Daniel

Thanks. Clear and easy.

By: K

Running jessie, thanks to your clear instructions.

By: Jozsi

As usual, on Linux nothing works...

apt-get update dies with Some index files failed to download. They have been ignored, or old ones used instead.