Debian squeeze (stable) broken packages after installing something from wheezy (testing)

apt

root@server:/home/ante# apt-get install build-essential
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 build-essential : Depends: libc6-dev but it is not going to be installed or
                            libc-dev
                   Depends: g++ (>= 4:4.4.3) but it is not going to be installed
E: Broken packages

I tried installing libv8-dev from wheezy, running squeeze. The install went smooth, no extra dependencies required really. I created an /etc/apt/apt.conf file specifying that stable was my default source. I then ran an apt-get update followed by an apt-get upgrade. Then I decided to install lua and saw lua5.2 using apt-cache search. I installed, removed wheezy links from sources.list and uninstalled lua. The order might be incorrect because it seems my libc6 was updated and loads of packages uninstalled. Now I'm left with this message.

Is there a way of avoiding reinstalling everything? I seem to have gotten libc6 2.13-26 instead of 2.11.3-3.

Best Answer

You don't say whether or not you want to end up with Squeeze or Wheezy. I will assume you want the former, in which case you can downgrade to it by giving it a high pin priority:

$ cat /etc/apt/preferences
Package: *
Pin: release stable
Pin-Priority: 9000

That way, running apt-get upgrade && apt-get dist-upgrade is going to 'upgrade' all installed packages to their Squeeze versions.

Related Question