Archives pour l'étiquette dpkg

[Debian] Utiliser un système mixte Stable / Oldstable ou Stable / Testing

Vous souhaiter utiliser un système Debian mixte qui combinerais des paquets Stable / Oldstable ou Stable / Testing. ? Personnellement je souhaitais installer une version récente de Fail2ban sur un serveur tournant avec une Debian Etch[1]. Pour des raisons de maintenance pas question de faire une installation depuis les sources. J’ai donc souhaité installer le paquet Fail2ban de Debian Lenny [2] sur cette Debian Etch.

APT::Default-Release

Pour ceci il est nécessaire de configurer Apt pour définir votre version principale de Debian. Ceci passe par l’ajout d’un paramètre dans l’arborescence de configuration de APT.

Créé un fichier 01Default-Release. Préfix en 01 pour qu’il soit charger dans les premiers

vi etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> apt.conf.d<span style="color: #000000; font-weight: bold;">/</span>01Default-Release

Ajouter l’instruction suivante dans le fichier 01Default-Release pour que la version principale de Debian reste en Oldstable / Etch

APT::Default-Release <span style="color: #ff0000;">&quot;oldstable&quot;</span>;

Dans la branche /etc/apt/apt.conf.d/ vous avez maintenant les fichiers suivant

<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>dweb2 <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> apt.conf.d<span style="color: #000000; font-weight: bold;">/</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>dweb2 <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>apt.conf.d<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #c20cb9; font-weight: bold;">ls</span> -l total <span style="color: #000000;">16</span> -rw-r--r-- <span style="color: #000000;">1</span> root root  <span style="color: #000000;">40</span> <span style="color: #000000;">2007</span><span style="color: #000000;">-04</span><span style="color: #000000;">-10</span> <span style="color: #000000;">11</span>:<span style="color: #000000;">45</span> 00trustcdrom -rw-r--r-- <span style="color: #000000;">1</span> root root  <span style="color: #000000;">34</span> <span style="color: #000000;">2009</span><span style="color: #000000;">-09</span><span style="color: #000000;">-16</span> <span style="color: #000000;">11</span>:<span style="color: #000000;">25</span> 01Default-Release -rw-r--r-- <span style="color: #000000;">1</span> root root <span style="color: #000000;">182</span> <span style="color: #000000;">2009</span><span style="color: #000000;">-09</span><span style="color: #000000;">-16</span> <span style="color: #000000;">11</span>:<span style="color: #000000;">21</span> 70debconf

Reste à modifier le source.list de apt en ajoutant le dépot main de lenny en plus de celuis de etch.

deb <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> etch main deb-src <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> etch main &nbsp; deb http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org<span style="color: #000000; font-weight: bold;">/</span> etch<span style="color: #000000; font-weight: bold;">/</span>updates main deb-src http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org<span style="color: #000000; font-weight: bold;">/</span> etch<span style="color: #000000; font-weight: bold;">/</span>updates main &nbsp; deb <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net<span style="color: #000000; font-weight: bold;">/</span>debian<span style="color: #000000; font-weight: bold;">/</span> lenny main contrib non-<span style="color: #c20cb9; font-weight: bold;">free</span>

Une mise à jour des paquets disponible s’impose avec un apt-get update.

<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>dweb2 <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #7a0874; font-weight: bold;">&#93;</span> apt-get update Atteint <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch Release.gpg Atteint <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny Release.gpg Réception de : <span style="color: #000000;">1</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch Release <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">67</span>,8kB<span style="color: #7a0874; font-weight: bold;">&#93;</span> Réception de : <span style="color: #000000;">2</span> http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org etch<span style="color: #000000; font-weight: bold;">/</span>updates Release.gpg <span style="color: #7a0874; font-weight: bold;">&#91;</span>835B<span style="color: #7a0874; font-weight: bold;">&#93;</span> Atteint http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org etch<span style="color: #000000; font-weight: bold;">/</span>updates Release Réception de : <span style="color: #000000;">3</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny Release <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">73</span>,6kB<span style="color: #7a0874; font-weight: bold;">&#93;</span> Réception de : <span style="color: #000000;">4</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch<span style="color: #000000; font-weight: bold;">/</span>main Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Ign <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch<span style="color: #000000; font-weight: bold;">/</span>main Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Ign http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org etch<span style="color: #000000; font-weight: bold;">/</span>updates<span style="color: #000000; font-weight: bold;">/</span>main Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Réception de : <span style="color: #000000;">5</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch<span style="color: #000000; font-weight: bold;">/</span>main Sources<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Ign <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch<span style="color: #000000; font-weight: bold;">/</span>main Sources<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Atteint <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch<span style="color: #000000; font-weight: bold;">/</span>main Packages Atteint <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch<span style="color: #000000; font-weight: bold;">/</span>main Sources Réception de : <span style="color: #000000;">6</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>main Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Ign <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>main Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Réception de : <span style="color: #000000;">7</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>contrib Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Ign <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>contrib Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Réception de : <span style="color: #000000;">8</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>non-<span style="color: #c20cb9; font-weight: bold;">free</span> Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Ign <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>non-<span style="color: #c20cb9; font-weight: bold;">free</span> Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Atteint <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>main Packages Ign http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org etch<span style="color: #000000; font-weight: bold;">/</span>updates<span style="color: #000000; font-weight: bold;">/</span>main Sources<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Atteint <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>contrib Packages Atteint <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>non-<span style="color: #c20cb9; font-weight: bold;">free</span> Packages Atteint http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org etch<span style="color: #000000; font-weight: bold;">/</span>updates<span style="color: #000000; font-weight: bold;">/</span>main Packages Atteint http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org etch<span style="color: #000000; font-weight: bold;">/</span>updates<span style="color: #000000; font-weight: bold;">/</span>main Sources 141ko réceptionnés en 0s <span style="color: #7a0874; font-weight: bold;">&#40;</span>1380ko<span style="color: #000000; font-weight: bold;">/</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> Lecture des listes de paquets... Erreur <span style="color: #000000; font-weight: bold;">!</span> E: Dynamic MMap ran out of room E: Erreur apparue lors <span style="color: #c20cb9; font-weight: bold;">du</span> traitement de tcptraceroute <span style="color: #7a0874; font-weight: bold;">&#40;</span>NewVersion2<span style="color: #7a0874; font-weight: bold;">&#41;</span> E: Problem with MergeList <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>lists<span style="color: #000000; font-weight: bold;">/</span>mir1.ovh.net_debian_dists_lenny_main_binary-i386_Packages E: Les listes de paquets ou le fichier « status » ne peuvent être analysés ou lus.

APT::Cache-Limit

ZUT !
le message d’erreur final indique un manque d’espace de cache. Nous allons donc configuré apt et luis augmenter son espace de travail. Pour cela on autre comme précédemment un fichier dans l’arborescence de configuration de APT.

vi etc<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #7a0874; font-weight: bold;">&#93;</span> <span style="color: #7a0874; font-weight: bold;">cd</span> apt.conf.d<span style="color: #000000; font-weight: bold;">/</span>02Cache-Limit

On ajoute le paramètre Cache-Limit sur l’exemple suivant

APT::Cache-Limit <span style="color: #000000;">20000000</span>;<span style="color: #ff0000;">&quot;;</span>

La mise à jour des paquets disponible s’impose toujours avec un apt-get update.

<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>dweb2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span> apt-get update Atteint <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch Release.gpg Atteint <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny Release.gpg Réception de : <span style="color: #000000;">1</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch Release <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">67</span>,8kB<span style="color: #7a0874; font-weight: bold;">&#93;</span> Réception de : <span style="color: #000000;">2</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny Release <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">73</span>,6kB<span style="color: #7a0874; font-weight: bold;">&#93;</span> Réception de : <span style="color: #000000;">3</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch<span style="color: #000000; font-weight: bold;">/</span>main Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Ign <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch<span style="color: #000000; font-weight: bold;">/</span>main Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Réception de : <span style="color: #000000;">4</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch<span style="color: #000000; font-weight: bold;">/</span>main Sources<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Ign <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch<span style="color: #000000; font-weight: bold;">/</span>main Sources<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Réception de : <span style="color: #000000;">5</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>main Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Ign <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>main Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Réception de : <span style="color: #000000;">6</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>contrib Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Ign <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>contrib Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Réception de : <span style="color: #000000;">7</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>non-<span style="color: #c20cb9; font-weight: bold;">free</span> Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Ign <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>non-<span style="color: #c20cb9; font-weight: bold;">free</span> Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Atteint <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch<span style="color: #000000; font-weight: bold;">/</span>main Packages Atteint <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net etch<span style="color: #000000; font-weight: bold;">/</span>main Sources Atteint <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>main Packages Atteint <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>contrib Packages Atteint <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>non-<span style="color: #c20cb9; font-weight: bold;">free</span> Packages Réception de : <span style="color: #000000;">8</span> http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org etch<span style="color: #000000; font-weight: bold;">/</span>updates Release.gpg <span style="color: #7a0874; font-weight: bold;">&#91;</span>835B<span style="color: #7a0874; font-weight: bold;">&#93;</span> Atteint http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org etch<span style="color: #000000; font-weight: bold;">/</span>updates Release Ign http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org etch<span style="color: #000000; font-weight: bold;">/</span>updates<span style="color: #000000; font-weight: bold;">/</span>main Packages<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Ign http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org etch<span style="color: #000000; font-weight: bold;">/</span>updates<span style="color: #000000; font-weight: bold;">/</span>main Sources<span style="color: #000000; font-weight: bold;">/</span>DiffIndex Atteint http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org etch<span style="color: #000000; font-weight: bold;">/</span>updates<span style="color: #000000; font-weight: bold;">/</span>main Packages Atteint http:<span style="color: #000000; font-weight: bold;">//</span>security.debian.org etch<span style="color: #000000; font-weight: bold;">/</span>updates<span style="color: #000000; font-weight: bold;">/</span>main Sources 141ko réceptionnés en 0s <span style="color: #7a0874; font-weight: bold;">&#40;</span>546ko<span style="color: #000000; font-weight: bold;">/</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> Lecture des listes de paquets... Fait <span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>dweb2 ~<span style="color: #7a0874; font-weight: bold;">&#93;</span>

apt-get install -t stable

Par de soucis cette fois
Dans la foulé on installe la version de fail2ban provenant du déport Debian stable avec la commande suivante qui précise par le -t la version à utiliser.

apt-get <span style="color: #c20cb9; font-weight: bold;">install</span> -t stable fail2ban

En vrais cela donne

<span style="color: #7a0874; font-weight: bold;">&#91;</span>root<span style="color: #000000; font-weight: bold;">@</span>dweb2 <span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #7a0874; font-weight: bold;">&#93;</span> apt-get <span style="color: #c20cb9; font-weight: bold;">install</span> -t stable fail2ban Lecture des listes de paquets... Fait Construction de l<span style="color: #ff0000;">'arbre des dépendances... Fait Les paquets supplémentaires suivants seront installés :   python-central Paquets suggérés :   python-gamin Les paquets suivants seront mis à jour :   fail2ban python-central 2 mis à jour, 0 nouvellement installés, 0 à enlever et 307 non mis à jour. Il est nécessaire de prendre 127ko dans les archives. Après dépaquetage, 188ko d'</span>espace disque supplémentaires seront utilisés. Souhaitez-vous continuer <span style="color: #7a0874; font-weight: bold;">&#91;</span>O<span style="color: #000000; font-weight: bold;">/</span>n<span style="color: #7a0874; font-weight: bold;">&#93;</span> ? o Réception de : <span style="color: #000000;">1</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>main python-central <span style="color: #000000;">0.6</span><span style="color: #000000;">.8</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">40</span>,4kB<span style="color: #7a0874; font-weight: bold;">&#93;</span> Réception de : <span style="color: #000000;">2</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>:<span style="color: #000000; font-weight: bold;">//</span>mir1.ovh.net lenny<span style="color: #000000; font-weight: bold;">/</span>main fail2ban <span style="color: #000000;">0.8</span><span style="color: #000000;">.3</span>-2sid1 <span style="color: #7a0874; font-weight: bold;">&#91;</span><span style="color: #000000;">86</span>,2kB<span style="color: #7a0874; font-weight: bold;">&#93;</span> 127ko réceptionnés en 0s <span style="color: #7a0874; font-weight: bold;">&#40;</span>486ko<span style="color: #000000; font-weight: bold;">/</span>s<span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>Lecture de la base de données... <span style="color: #000000;">32770</span> fichiers et répertoires déjà <span style="color: #c20cb9; font-weight: bold;">install</span>és.<span style="color: #7a0874; font-weight: bold;">&#41;</span> Préparation <span style="color: #c20cb9; font-weight: bold;">du</span> remplacement de python-central <span style="color: #000000;">0.5</span><span style="color: #000000;">.12</span> <span style="color: #7a0874; font-weight: bold;">&#40;</span>en utilisant ...<span style="color: #000000; font-weight: bold;">/</span>python-central_0<span style="color: #000000;">.6</span>.8_all.deb<span style="color: #7a0874; font-weight: bold;">&#41;</span> ... Dépaquetage de la mise à jour de python-central ... Préparation <span style="color: #c20cb9; font-weight: bold;">du</span> remplacement de fail2ban <span style="color: #000000;">0.7</span><span style="color: #000000;">.5</span>-2etch1 <span style="color: #7a0874; font-weight: bold;">&#40;</span>en utilisant ...<span style="color: #000000; font-weight: bold;">/</span>fail2ban_0<span style="color: #000000;">.8</span><span style="color: #000000;">.3</span>-2sid1_all.deb<span style="color: #7a0874; font-weight: bold;">&#41;</span> ... Dépaquetage de la mise à jour de fail2ban ... Paramétrage de python-central <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0.6</span><span style="color: #000000;">.8</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> ... &nbsp; Paramétrage de fail2ban <span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #000000;">0.8</span><span style="color: #000000;">.3</span>-2sid1<span style="color: #7a0874; font-weight: bold;">&#41;</span> ...

Voila tout baigne, fail2ban est installé depuis le depot lenny.

A lire également chez d’autre

Notes

[1] Version Oldstable depuis le 14 février 2009

[2] la version stable courante depuis le 14 février 2009

Réinstaller un serveur debian presque à l’identique

Principe

A partir d’un serveur de référence installer un autre serveur avec exactement les mêmes paquets (et donc service) rapidement.

En pratique

Extraire la liste des paquets utilisés sur le serveur de référence


dpkg --get-selections '*' > mes_paquets.txt

L’utilisation dpkg —get-selections ‘*’ en lieu et place de dpkg —get-selections de te permet de prendre en compte l’état de tous les paquets disponibles, et pas uniquement ceux installés. Ceci affine encore davantage les similarités entre les deux installations. (Merci Gui)

Puis à partir de cette liste de paquet tout réinstaller.


dpkg --set-selections < mes_paquets.txt
apt-get update
apt-get dselect-upgrade
apt-get dist-upgrade
apt-get upgrade

Restaurer votre base apt / dpkg

Houlala bad Karma

Quand je fais un apt-get update apt me reponds :

Reading Package Lists... Error !
Unable to parse package file /var/lib/dpkg/status (1)
The package lists or status file could not be parsed or opened.

Malheureusement, le message est clair non ? Le fichier status n’est plus lisible, j’ai plus de base dkpg et j’ai donc perdu la liste des paquets installés et leur version.

Bon je fais tout de meme les verifications d’usage : df -h. Histoire de voir si un fs est a 100 %, rien tout est normal.

status-old

Il y a normalement un fichier /var/lib/dpkg/status-old qui contient l’etat de ton systeme avant la derniere mise a jour. Je fonce dessus et j’en fais immédiatement une copie dans un coin avant de me lancer dans le bricolage.

Si vraiment le fichier status a degagé, il est possible de faire une copie de status-old en status puis reinstaller les paquets que tu avais installes en dernier pour mettre la base plus ou moins à jour. C’est pas garanti a 100 % mais ca devrait tout de meme faire l’affaire. Y’a aussi plein de fichier status.yesterday.0,1.gz,2.gz,etc…. ils correspondent aux fichiers status-old des jours précédent. La encore il est possible de les utiliser sachant qu’a chaque fois on perd plusieur jour de d’upgrade.

De toute facons, j’ai pas le choix, c’est ca ou une reinstallation from scratch.

Hack

Bon si c’est vraimment impossible de retrouver un version valable de /var/lib/dpkg/status il est toujours possible de retrouver la liste des paquets installés et de les installer de nouveau

# ls /usr/share/doc | \ grep -v [A-Z] | \ grep -v '^texmf$' | \ grep -v '^debian$' | \ awk 'print $1 " install"' | \ dpkg --set-selections

A la suite de cela lancer la ré-installation avec dselect : # dselect --expert

Choisir l’option d’installation. Attention chez moi sur mom portable cela représente plus de 1G0 de paquet à télécharger.