As you know, Debian stable is always stable, like a brick. Testing becomes such only in the second half of stay in testing. What to do if testing was registered everywhere in sources.list in your beloved Debian Lenny, and when Lenny became stable on February 14, your system was updated to Squeeze, thereby bringing a bunch of minor and unpleasant bugs? Officially, the downgrade is not supported - but this does not mean that it is not possible. I could not find the instructions for the downgrade with Squeeze (all instructions are quite old), therefore I decided to write this one.
So, for a start, we need to climb into /etc/apt/sources.list and replace testing and squeeze with stable, bringing everything to something like this:
deb mirror.yandex.ru/debian stable main contrib non-free
deb security.debian.org stable/updates main contrib non-free
So, first we need to deal with apt-pinning. Create a file / etc / apt / preferences with similar content:
Package: *
Pin: release a=stable
Pin-Priority: 1001
Package: *
Pin: release a=testing
Pin-Priority: 60
Package: *
Pin: release a=unstable
Pin-Priority: 50
Thus, priority will be given to packages from a stable repository.
Now update the package information:
$ sudo apt-get update
And we make the first downgrade attempt:
$ sudo apt-get dist-upgrade
If everything goes well, then we will be shown that it is necessary to downgrade about a thousand packages, remove a few dozen (and not only some unimportant things can be among them, but also quite used software, in my case - gedit and deluge. Nothing put it later). We agree, downgrade a certain number of packages, stumble upon the first error:
dpkg: error processing /var/cache/apt/archives/gstreamer0.10-plugins-good_0.10.8-4.1~lenny1_i386.deb (--unpack):
trying to overwrite `/usr/lib/gstreamer-0.10/libgstcdio.so', which is also in package gstreamer0.10-plugins-ugly
dpkg-deb: subprocess paste killed by signal (Broken pipe)
We treat it, in general, at random. With some helps:
$ sudo dpkg -i --force-overwrite /var/cache/apt/archives/gstreamer0.10-plugins-good_0.10.8-4.1~lenny1_i386.deb
Some of them manage to be cured through Synaptic: either Edit> Broken Packages, or use the Broken Packages filter and try to remove / reinstall one at a time.
It is often not possible to deliver with --force-overwrite due to unsatisfied dependencies:
$ sudo dpkg -i --force-overwrite /var/cache/apt/archives/gconf2-common_2.22.0-1_all.deb
dpkg - warning: downgrading gconf2-common from 2.26.0-1 to 2.22.0-1.
(Reading database ... 248673 files and directories currently installed.)
Preparing to replace gconf2-common 2.26.0-1 (using .../gconf2-common_2.22.0-1_all.deb) ...
Unpacking replacement gconf2-common ...
dpkg: dependency problems prevent configuration of gconf2-common:
gconf2-common depends on ucf; however:
Package ucf is not configured yet.
dpkg: error processing gconf2-common (--install):
dependency problems - leaving unconfigured
Errors were encountered while processing:
gconf2-common
Well, we put dependences:
$ sudo dpkg -i --force-overwrite /var/cache/apt/archives/ucf_3.0016_all.deb
(Reading database ... 248668 files and directories currently installed.)
Preparing to replace ucf 3.0016 (using .../archives/ucf_3.0016_all.deb) ...
Unpacking replacement ucf ...
Setting up ucf (3.0016) ...
Processing triggers for man-db ...
... and again we put the package itself:
$ sudo dpkg -i --force-overwrite /var/cache/apt/archives/gconf2-common_2.22.0-1_all.deb
(Reading database ... 248668 files and directories currently installed.)
Preparing to replace gconf2-common 2.22.0-1 (using .../gconf2-common_2.22.0-1_all.deb) ...
Unpacking replacement gconf2-common ...
Setting up gconf2-common (2.22.0-1) ...
Replacing config file /etc/gconf/2/path with new version
There are packages to which we cannot satisfy the dependencies - they appeared only in Squeeze. So, we simply do not need them:
sudo dpkg --remove libnm-util1
If something depends on them - great, first remove the dependent package, then go back to that.
Getting through the first (largest) portion of errors, we renew our
$ sudo apt-get dist-upgrade
and repeat the procedure.
As a result, we have a completely normal Debian Lenny. Although, of course, problems are possible. In my case, problems have arisen with the /usr/lib/libgssapi_krb5.so.2 library. Without it, it was impossible to log in (except in safe mode), and some programs did not work. I had to take this library from Squeeze and put it in Lenny - everything worked perfectly.