2

I installed some unstable packages on my wheezy and now some libraries and other dependencies are all mixed up because the newer versions were installed than the ones that the packages from stable are using.

Is there any way to fix this and restore all packages back to latest stable version even though they are now installed with higher versions from unstable?

Here is my sources.list:

deb http://ftp.debian.org/debian wheezy main contrib non-free
deb http://security.debian.org wheezy/updates main contrib non-free
#deb http://ftp.debian.org/debian unstable main contrib non-free
4
  • 1
    Can you uninstall the packages that you installed from unstable ?
    – Lawrence
    Jul 16, 2014 at 7:53
  • 1
    Well, yes but they also upgraded a lot of other dependencies so old packages from stable won't work because they are expecting older libraries etc.
    – j99
    Jul 16, 2014 at 8:30
  • 1
    Starting from scratch is probably easier. Either that or uninstall all the packages that were upgraded - which could be difficult/impossible.
    – Lawrence
    Jul 16, 2014 at 8:33
  • 1
    I managed it... Here's what I've done: 1) created a file /etc/apt/preferences.d/stable Package: * Pin: release a=stable Pin-Priority: 1001 2) removed all "unstable" stuff from /etc/apt/sources.list 3) apt-get update && apt-get dist-upgrade -u && apt-get autoremove this reinstalled all the broken packages and removed the unstable packages and references. Only thing that didn't start was apache2 because it was complaining that it can't found some modules which were installed and enabled with unstable apache2 version so I had to disable these modules and now it's OK.
    – j99
    Jul 16, 2014 at 8:49

1 Answer 1

3

The way you followed is the standard way, i.e. provide packages from a given version (stable, in your case) with higher priority than other repos. The Debian admin handbook states that you can revert to stable by modifying the file /etc/apt/preferences as follows:

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

 Package: *
 Pin: release o=Debian
 Pin-Priority: -10

The first stanza raises the priority of all packages in the stable release, the second stanza limits this effect to all packages whose origin is Debian.

After you are done, you may double-check your work by means of

 aptitude search '?narrow(?installed, !?archive(stable))'

This will list all packages which are not from the stable release.

You must log in to answer this question.

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