Downgrade from Debian SID to Stable from Jessie to Wheezy

Downgrade from Debian SID to Stable from Jessie to Wheezy

Downgrade from Debian SID to Stable from Jessie to Wheezy
Logo of the Debian GNU/kFreeBSD project Credit: Debian/Open Use Logo Licence.

Downgrade from Debian SID to Stable from Jessie to Wheezy. This Tutorial describes the downgrade process you need to run to ge back stable rel after sid upgrade. Recently, a problem occurred on my server after i had upgraded my system with the SID repository in my sources.list. The Debian release jessie came out and after upgrading to this release some services no longer ran properly anymore. So I had to run a task to get back to Wheezy to recover the failing services.


So here are the few easy steps you will need to downgrade a Debian SID release to Wheezy or any kind of other release you like:

First of all you have to remove or replace all SID tags from your /etc/apt/sources.list to your preffered target release

Mine sources.list file looks like this after changes have made:

deb http://security.debian.org/ wheezy/updates main
deb-src http://security.debian.org/ wheezy/updates main

deb http://cdn.debian.net/debian/ wheezy main contrib non-free
deb-src http://cdn.debian.net/debian/ wheezy main contrib non-free

Now we have to use the Apt-Pinning feature to get the correct default release tag for our apt downgrade

Modify or create the file /etc/apt/preferences and put following text in it:

Package: *
Pin: release a=stable
Pin-Priority: 1001

Finally we have to run the apt update and upgrade process for downgrading all packages

So you will need to enter these two commands to finish the downgrade process:

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

Apt will ask you for downgrading all packages now.
Just say yes, let it go and pray that all packages getting installed and downgraded properly!

If some packages failing on downgrade you have to purge them by doing:

apt-get purge yourfailingpackage

And reinstall them with apt-get install yourfailingpackage after purging it.

16 thoughts on “Downgrade from Debian SID to Stable from Jessie to Wheezy”

  1. Thanks! I actually had to do an additional ‘apt-get dist-upgrade’ to downgrade packages with assumingly a different version number in the two editions.

  2. Thanks so much, an excellent article for something that should be easily found in the Debian manuals

    1. Well it’s not the best but working solution. Debian would never recommend it since it also can break your whole system.
      But if you have just this only chance it will do and mostly well ;-)

  3. In my case it didn’t work.

    Issue with systemd vs. sysvinit.

    I learned that I was supposed to switch from systemd back to sysvinit-core and do a reboot to use that one before downgrading package versions. This way the installer keept stoping because it couldn’t remove systemd. I tried to go back up jessie, install sysvinit-core and do a reboot, unfortunally the system was left in so an unusuable state, it didn’t boot.

    I ended up putting a wheezy installer USB on it, removing everything but the home folder from install root and do a clean reinstall to wheezy.

    1. Where it stopped to boot finally? What error messages you get?
      For me it sounds more like an shell issue. Probably default shell were set to dash and thus will break up init scripts at all.
      dpkg-reconfigure dash – whats selected there (yes/no)?

      1. It won’t let one deinstall systemd while the system is running systemd, I searched about that and the common opinion was one should revert the system to use sysvinit-core then reboot, than remove or purge systemd. However I couldn’t reboot since the system was currently broken, but I also couldn’t fix to the previous state, since package management keept refusing to let go of the systemd package, with all kind of dependencies. I can’t answer questions anymore, since I reinstalled wheezy the proper way already, using an usb stick and moving the testing system with an installer shell out of place.

        So my idea is, before you downgrade install sysvinit-core and revert to it before downgrading. Maybe your jessie was not yet converted to systemd before the downgrade? Or likely I just did something wrong missing a proper force, just -f didnt cut it.

        In this case it wasn’t a big issue since I had physical access to the machine anyway, I was at first just lazy to do it the debian adviced way.

  4. I get this problem after removing the systemd package. System isnt booting, so I am doing this all in chroot. Kindly advise.

    # apt-get install -f
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Correcting dependencies… Done
    The following packages were automatically installed and are no longer required:
    app-install-data docutils-common docutils-doc gdebi-core gnustep-base-common
    gnustep-base-runtime gnustep-common gnustep-gui-common hplip-data
    i965-va-driver ieee-data ipxe-qemu libaio1 libaqbanking-data libaqbanking34
    libaqofxconnect7 libarchive12 libart-2.0-2 libasan1 libasn1-8-heimdal
    libatomic1 libavresample2 libavutil54 libbfio1 libboost-thread1.55.0
    libbrlapi0.5 libcap2-bin libchromaprint0 libcogl-common libdrm-nouveau2
    libdvbpsi9 libebml4 libelf1 libepoxy0 libewf2 libfdt1 libfreerdp1
    libgles2-mesa libglib2.0-bin libgnustep-base1.22 libgssapi3-heimdal
    libgutenprint2 libgwenhywfar-data libgwenhywfar60 libhcrypto4-heimdal
    libheimbase1-heimdal libheimntlm0-heimdal libhx509-5-heimdal libiscsi1
    libiscsi2 libjson-c2 libkrb5-26-heimdal libktoblzcheck1c2a libldb1
    liblua5.2-0 libmatroska6 libntdb1 libobjc4 libopenvg1-mesa
    libpackagekit-glib2-14 libpam-cap libproxy-tools libproxy1 libqpdf13
    libroken18-heimdal libseccomp2 libsnmp-base libspice-server1 libswscale3
    libsystemd-daemon0 libsystemd-id128-0 libsystemd-journal0 libtevent0
    libtsk10 libtxc-dxtn-s2tc0 libubsan0 libusageenvironment1 libusbredirparser0
    libusbredirparser1 libvdeplug2 libwebrtc-audio-processing-0 libwind0-heimdal
    libxen-4.1 libxmlsec1 libxmlsec1-gcrypt libxmlsec1-gnutls
    linux-headers-3.14-1-common linux-headers-3.14-2-common linux-kbuild-3.14
    openbios-ppc openbios-sparc openhackware packagekit packagekit-backend-aptcc
    packagekit-tools pulseaudio-utils python-crypto python-debian
    python-docutils python-ldb python-ntdb python-packagekit python-pexpect
    python-ply python-pycparser python-pygments python-renderpm python-reportlab
    python-reportlab-accel python-roman python-six python-talloc python-tdb
    python-wstools python3-apt python3-chardet python3-dbus python3-six
    qemu-keymaps qemu-slof qpdf rtkit seabios sharutils tk va-driver-all
    vdpau-va-driver vgabios
    Use ‘apt-get autoremove’ to remove them.
    The following extra packages will be installed:
    gcc hplip-data libaqbanking34 libpython2.7 libsmbclient libxmlsec1-gcrypt
    libxmlsec1-gnutls python python2.7 python2.7-minimal
    Suggested packages:
    gcc-multilib autoconf automake1.9 libtool flex bison gdb gcc-doc hplip
    aqbanking-tools python-doc python-tk python2.7-doc
    Recommended packages:
    libaqbanking-plugins-libgwenhywfar60
    The following packages will be REMOVED:
    gcc-4.9 libaqbanking34-plugins libaqebics0 libaqhbci22 libpython-stdlib
    libpython2.7-stdlib python-cffi python-cryptography python-debianbts
    python-defusedxml python-reportbug python-soappy
    The following packages will be DOWNGRADED:
    gcc hplip-data libaqbanking34 libpython2.7 libsmbclient libxmlsec1-gcrypt
    libxmlsec1-gnutls python python2.7 python2.7-minimal
    0 upgraded, 0 newly installed, 10 downgraded, 12 to remove and 150 not upgraded.
    10 not fully installed or removed.
    Need to get 0 B/14.5 MB of archives.
    After this operation, 16.9 MB disk space will be freed.
    Do you want to continue [Y/n]?
    Could not find platform independent libraries
    Consider setting $PYTHONHOME to [:]
    ImportError: No module named site
    Can not write log, openpty() failed (/dev/pts not mounted?)
    (Reading database … 131465 files and directories currently installed.)
    Removing python-cryptography …
    Could not find platform independent libraries
    Consider setting $PYTHONHOME to [:]
    ImportError: No module named site
    dpkg: error processing python-cryptography (–remove):
    subprocess installed pre-removal script returned error exit status 1
    Could not find platform independent libraries
    Consider setting $PYTHONHOME to [:]
    ImportError: No module named site
    dpkg: error while cleaning up:
    subprocess installed post-installation script returned error exit status 1
    Removing python-cffi …
    Could not find platform independent libraries
    Consider setting $PYTHONHOME to [:]
    ImportError: No module named site
    dpkg: error processing python-cffi (–remove):
    subprocess installed pre-removal script returned error exit status 1
    Removing python-reportbug …
    Could not find platform independent libraries
    Consider setting $PYTHONHOME to [:]
    ImportError: No module named site
    dpkg: error processing python-reportbug (–remove):
    subprocess installed pre-removal script returned error exit status 1
    Removing python-debianbts …
    Could not find platform independent libraries
    Consider setting $PYTHONHOME to [:]
    ImportError: No module named site
    dpkg: error processing python-debianbts (–remove):
    subprocess installed pre-removal script returned error exit status 1
    Removing python-soappy …
    Could not find platform independent libraries
    Consider setting $PYTHONHOME to [:]
    ImportError: No module named site
    dpkg: error processing python-soappy (–remove):
    subprocess installed pre-removal script returned error exit status 1
    Removing python-defusedxml …
    Could not find platform independent libraries
    Consider setting $PYTHONHOME to [:]
    ImportError: No module named site
    dpkg: error processing python-defusedxml (–remove):
    subprocess installed pre-removal script returned error exit status 1
    Errors were encountered while processing:
    python-cryptography
    python-cffi
    python-reportbug
    python-debianbts
    python-soappy
    python-defusedxml
    E: Sub-process /usr/bin/dpkg returned an error code (1)

    I am unable to delete these packages too.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>