2

Another sysadmin added the following to sources.list:

deb http://ftp.de.debian.org/debian testing main

At some point in time a apt-get upgrade was run, causing most packages to be updated a alpha or beta package. For example apt:

$ apt-cache policy apt
apt:
  Installed: 1.8.0~alpha3
  Candidate: 1.8.0~beta1
  Version table:
     1.8.0~beta1 500
        500 http://ftp.de.debian.org/debian testing/main amd64 Packages
 *** 1.8.0~alpha3 100
        100 /var/lib/dpkg/status
     1.0.9.8.5 500
        500 http://security.debian.org jessie/updates/main amd64 Packages
     1.0.9.8.4 500
        500 http://debian.mirrors.ovh.net/debian jessie/main amd64 Packages

I do not have a list of packages which have been upgraded, this wouldn't be really much of an issue however, if I now disable the testing source and try to install anything there's many dispensary issues from mismatching version numbers.

Is there a way to downgrade all packages to the best candidate for the jessie source? Or get a list of all packaged that are installed from the tested source?

2
  • 4
    fyi: debian jessie is 8, testing or buster is 10. Your testing packages are from two versions ahead of the old-stable or jessie packages. Even if you push packages back, some of your .conf (config) files may have been upgraded beyond what the old release can handle (I've had this occur before, new options are set that old version couldn't cope with)
    – guiverc
    Feb 7, 2019 at 9:54
  • @A.B Fixed for Jessie , stretch , buster and Sid.
    – GAD3R
    Feb 7, 2019 at 21:04

1 Answer 1

0

Backup your data, then edit your /etc/apt/sources.list by removing the testing repository.

Create a preferences file :

editor /etc/apt/preferences

Then past the following lines:

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

AptPreferences

Note that a priority above 1000 will allow even downgrades no matter the version of the prioritary package. This means that you can use priority 1001 for a stable source if you want to downgrade to the stable versions of the packages you have installed (let's say from testing) on the system. this is not recommended unless the number of changes are minimal.

Save your file then run:

apt update
apt upgrade
apt dist-upgrade
apt autoremove

Emergency downgrading

Downgrading is not officially supported by the Debian by design. It should be done only as a part of emergency recovery process. Despite of this situation, it is known to work well in many incidents. For critical systems, you should backup all important data on the system after the recovery operation and re-install the new system from the scratch.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .