The Santino

hCard
photo

Readers via RSS

Calendar

January: 2012
The M M G V S D
"November
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31

Service

Archives

Categories

Debian: to downgrade a package

Debian GNU / Linux Open Logo Although my knowledge of Debian now goes back five years ago, these days I found myself in a situation entirely new to me and that I have seen the need to install - or rather, re-install - several packages with versions lower than those installed. Put simply: I had a mixed system based on testing and unstable and the need to return completely to testing. This, the 'inverse of' upgrade is called with a great effort of imagination downgrade.

Synaptic allows you to downgrade a package with a degree of fluency: you select the package and then select the appropriate heading `Force` menu `package version`.

Obviously this only works for those packages that have dependencies to be satisfied. But I found myself in a situation where most of the tool-chain, the X and several packages called `essential` came from unstable. How do?

In my case, having used the pinning in order to have a mixed system with reasonable security, the first thing to do was put his hand to the APT system configuration files: / etc / apt / preferences and / etc / apt / apt. conf.

As far as I proceeded to delete any preferences other than the setting below:
$ cat /etc/apt/preferences
Package: *
Pin: release o=testing
Pin-Priority: 1001

This approach guarantees that the only packages that will take precedence over all other are those coming from the branch `testing`.

In the apt.conf file, however, I proceeded to check that `testing` was indicated as the default version for the system.
$ cat /etc/apt/apt.conf
APT::Default-Release "testing";
APT::Cache-Limit 15000000;
Apt::Get::Purge;
APT::Clean-Installed;
APT::Get::Fix-Broken;
APT::Get::Fix-Missing;
APT::Get::Show-Upgraded "true";

Now we eliminate any source other than from our `testing` sources.list and update the package database in the usual way:
$ sudo apt-get update
$ sudo apt-get dist-upgrade

It is important to understand that the removal of programs essenzialisenza the necessary precautions and measures inevitably leads to a series of severe abnormalities (non-functioning of the 'interface, network, etc ...), to meet again to have an operating system unusable or even not able Bootstrap. While we are doing the downgrade concentrate exclusively on this task, we do not use unnecessary programs, we always read 4 times' video output to avoid doubt and to remove anything.

Make sure you have at hand a few key programs:
$ sudo apt-get install wget apt-show-versions
The first essential is to download (even in situations of emergency) number of packages that will serve us and the second allows us to identify installed packages with newer version than that used in the testing branch (and therefore from unstable).

In a terminal identify the packages that we want to downgrade. In 'example, I use one package, but the list is much longer.
$ apt-show-versions |grep newer
[...]
pciutils 1:2.2.4-1 newer than version in archive
[...]

The filters grep 's output of the command and it shows only the packages you wanted.

groped in the first move is to remove the package using apt: if it is not listed among the dependencies of other programs' operation will fail, but if not we will have a tremendous help in the next step. If apt fails to uninstall the package, in fact, we inform you of other packages which keep him locked.
$ sudo apt-get remove pciutils
Lettura della lista dei pacchetti in corso... Fatto
Generazione dell'albero delle dipendenze in corso
Reading state information... Fatto
I seguenti pacchetti saranno RIMOSSI:
alsa-utils glide2-bin gnome-mount gnome-power-manager
gnome-volume-manager hal libglide2 network-manager network-manager-gnome
pciutils update-notifier
0 aggiornati, 0 installati, 12 da rimuovere e 0 non aggiornati.
È necessario prendere 0B di archivi.
Dopo l'estrazione, verranno liberati 31,0MB di spazio su disco.
Continuare [S/n]?

From 'output we note that, although apt to be able to remove the package, uninstalling also leads to the removal of other packages, with unpredictable effects. in this case is much better to go directly to remove the desired package without touching the others.

In the case of the dependencies of the package there is also apt, or whether it's a program that shows how the same apt ESSENTIAL, prior to its removal, make sure you download the correct version from the Internet, so you should still be able to reinstall it using dpkg. For this purpose it proves useful to the package search page hosted on the Debian site.

To uninstall the package without the involvement of its dependencies, we can use a less sophisticated instrument a tool apt, but more powerful than dpkg.
$ sudo dpkg --force-depends -r pciutils
dpkg: pciutils: problemi con le dipendenze, ma lo rimuovo comunque come richiesto:
libglide2 dipende da pciutils.
alsa-utils dipende da pciutils (>= 1:2.1.11-4).
hal dipende da pciutils.
(Lettura del database ... 119085 file e directory attualmente installati.)
Rimuovo pciutils ...

We were able to uninstall the program without trying to resolve the dependencies that Debian. We must pay attention now: the operating system is in a very delicate and must be met those dependencies that we have ignored its own beautifully a moment ago. Having removed any source relating to `unstable` But we're going to install the package it will be the version from `testing` we need!

Pciutils reinstalled via apt, it will download from the 'single repository available: testing.
$ sudo apt-get install pciutils
Lettura della lista dei pacchetti in corso... Fatto
Generazione dell'albero delle dipendenze in corso
Reading state information... Fatto
I seguenti pacchetti NUOVI (NEW) saranno installati:
pciutils
0 aggiornati, 1 installati, 0 da rimuovere e 0 non aggiornati.
È necessario prendere 206kB di archivi.
Dopo l'estrazione, verranno occupati 680kB di spazio su disco.
Get:1 http://debian.fastweb.it testing/main pciutils 1:2.2.4~pre4-1 [206kB]
Scaricato 206kB in 1s (106kB/s)
Selezionato il pacchetto pciutils, che non lo era.
(Lettura del database ... 119066 file e directory attualmente installati.)
Spacchetto pciutils (da .../pciutils_1%3a2.2.4~pre4-1_i386.deb) ...
Configuro pciutils (1:2.2.4~pre4-1) ...

If apt could not install it because of some conflict with other installed packages or we can simply download the remaining configurations (using wget or a browser) and then install it using dpkg as follows:
dpkg -i --force-overwrite /percorso/del/PACCHETTO

Happy Debian!


Tags: , , , , , ,

6 comments to Debian to downgrade a package

  • a little 'for me ... it's a Kind of Magic! ;-)

  • [...] Complete guide of Keltika (kk) Â [...]

  • Loske

    Help really super! Useful, clear, saved me! Great!

  • Mark

    Interesting ... ..
    would be interesting to have other details:
    When we completed the procedure that you describe some of the packages we find that they still have as reference the new version of pciutils. This may result in malfunction of the rest of the programs that depend on pciutils?
    If you wish to restore the original situation what to do?

  • packages that depend on the version of 'newer' pciutils are necessarily of their 'newer' than the version currently in use. I'll explain: when I install pciutils from unstable, the package will install all the dependencies from unstable and also requests that depend on pciutils packages will be upgraded to unstable. When we return to a previous release, all these packages will * necessarily * marked as 'newer'.

    to restore the original situation you want to downgrade packages you have installed to date, should be explained at the 'beginning of the guide.

Leave a Reply

You can use HTML tags These

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>