75

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

7 Answers 7

82

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
    
15
  • 3
    With Jessie now officially out, and running on my desktop, is this still the correct answer for my Raspbian Wheezy Pi? Commented May 1, 2015 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
    Commented May 1, 2015 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. Commented May 5, 2015 at 12:09
  • 2
    why upgrade then dist-upgrade? Commented Nov 21, 2015 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
    Commented Nov 21, 2015 at 10:29
39

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
4
  • 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 Commented Feb 20, 2015 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. Commented Nov 7, 2015 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. Commented Nov 7, 2015 at 14:51
  • Although this isn't the recommended way of doing things, this is the one that worked for me.
    – FaCE
    Commented Apr 9, 2020 at 11:22
8
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.

7

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

1

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.

1

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.

0

Cause I'm too lazy and just want to copy'n'paste from now on - the same for Jessie to Stretch:

  1. Update before and clean up

    sudo apt update
    sudo apt full-upgrade
    sudo apt autoremove
    
  2. Adjust the repository sources:

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

    sudo apt update
    sudo apt upgrade
    sudo apt full-upgrade
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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