How can I perform an upgrade from Raspbian Wheezy to Jessie?

up vote 76 down vote accepted

How brave do you feel? It's safest to make a fresh install on a new SD card.

The braver way I'd use is:

  1. Backup any files which are important to you.

  2. With your new or existing install.

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get dist-upgrade
    

    to make sure wheezy is fully up to date.

  3. Edit /etc/apt/sources.list and change wheezy to jessie. There may also be files in /etc/apt/sources.list.d/ that also need updating, to replace wheezy with jessie.

  4. Then update and upgrade again

    sudo apt-get update
    sudo apt-get upgrade
    sudo apt-get dist-upgrade
    
  • 3
    With Jessie now officially out, and running on my desktop, is this still the correct answer for my Raspbian Wheezy Pi? – Wayfaring Stranger May 1 '15 at 19:14
  • 2
    It's still a reasonable approach and is what I would do and have done. Fragmentation Needed points out that there are other source repositories you might want to update at the same time. In the past I've removed those repositories as I don't use their software. – joan May 1 '15 at 19:26
  • 2
    @Wayfaring Stranger The raspbian images have not been updated to jessie so far, so this is still the way to go. Unfortunately. – Fragmentation Needed May 5 '15 at 12:09
  • 2
    why upgrade then dist-upgrade? – Jaromanda X Nov 21 '15 at 9:27
  • 4
    @JaromandaX To try to minimise the amount of packages to be updated at any one time and to try to keep the system in a stable state. At the end of the upgrade you should have the earlier version at its most up to date stable release. That seems (to me) to be the best start point for an upgrade to a later release. – joan Nov 21 '15 at 10:29

I hope this may help others in the next time: Basically, an upgrade works like this:

  1. adjusting the sources to "jessie"
  2. update the package lists and upgrade the packages

adjusting the sources

  • You can either simply replace every "wheezy" in /etc/apt/sources.list (and /etc/apt/sources.list.d/*) with "jessie"
  • Or you use sed to do the work for you:

    sudo sed -i /deb/s/wheezy/jessie/g /etc/apt/sources.list
    sudo sed -i /deb/s/wheezy/jessie/g /etc/apt/sources.list.d/*.list
    

update the package lists

This may take quite a while, since everything has to be downloaded and all dependencies need to be rebuilt. Also, the upgrade and dist-upgrade parts require some interaction:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
  • There is a repository here that seems not to have been updated lately and that does not contain any jessie packages: /etc/apt/sources.list.d/raspi.list – Fragmentation Needed Feb 20 '15 at 11:45
  • 2
    I used this procedure to update Wheezy (In Nov 2015) to Jessie. As written, it performed an incomplete upgrade. Adding deb http://archive.raspberrypi.org/debian/ jessie main ui to /etc/apt/sources.list.d/raspi.list and again running apt-get update/upgrade solved the problem. – bobthechemist Nov 7 '15 at 14:49
  • The modification I mention above solved a problem with the menus in raspi-config not being updated (preventing the ability to boot to console) and installing wolfram/Mathematica. – bobthechemist Nov 7 '15 at 14:51
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
sudo sed -i /deb/s/wheezy/jessie/g /etc/apt/sources.list
sudo sed -i /deb/s/wheezy/jessie/g /etc/apt/sources.list.d/*.list
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

There may be an error after upgrade. Make sure you press N, not Y on prompts related to systemd, lightdm, dbus and other booting related things(Doesn't matter on other programs you can press y) on dist-upgrade to jessie.

Just an addition for users that could land here looking for the upgrade procedure, like me!

On the official Raspberry Pi website the update from Wheezy to Jessie is discouraged. Instead they recommend to make a clean Jessie install.

From https://www.raspberrypi.org/blog/raspbian-jessie-is-here/:

Starting with a clean image is the recommended way to move to Jessie. If you really need to update a Wheezy image, we have tried an unsupported upgrade path which is documented on the forums here. This has been shown to work on a vanilla Wheezy image, but we can’t predict what effect it may have on any packages or data that you have installed, so this is very much at your own risk.

And for those who are brave, this is the forum post where all the passages for the update are explained.

https://www.raspberrypi.org/forums/viewtopic.php?f=66&t=121880

On my raspberry Pi2, after each upgrade, the login service failed, preventing to logon locally. Fortunately I was able to logon remotely through SSH.

Based on my investigation, I found an issue with the dbus service which didn't start anymore after the upgrade.

The workaround I used:

  1. Reinstall the RaspBian
  2. Remove the dbus service ==> apt-get remove dbus
  3. Upgrade to Jessie

Hope it helps.

I found this thread in a Google search. I'm adding my "answer" in case there are others, like myself, still wandering in the wilderness with a now very old, and probably insecure, version of Raspbian. Here goes:

I followed the approach given by Bex (over 3 years ago now!), and it worked :) I did have a minor issue with some failed dependencies at one point, but was able to resolve those by following the suggestions offered in the error message from Raspbian.

All of that said, I feel the "best" approach for most people will be to follow the recommendations in Raspberry Pi's forums, and do a clean install. I've not experienced any issues yet, but my RPI is mostly "stock", being used for the odd experiment now and again. There may still be issues lurking somewhere in my system.

Subsequent to Bex's post, this was posted in the RPI forums:

How to upgrade a Wheezy image to Jessie (both defunct and replaced versions of Raspbian)

And so for anyone who stumbles across this thread while searching for a formula to use in upgrading, I respectfully submit this is the "best" answer.

Your Answer

 
discard

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.