Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
linux:gestion_des_paquets_apt [03/11/2018 14:51] thierry [Lister les paquets installés] |
linux:gestion_des_paquets_apt [19/05/2021 10:52] (Version actuelle) thierry [Résolution] |
||
---|---|---|---|
Ligne 28: | Ligne 28: | ||
==== Supprimer des paquets ==== | ==== Supprimer des paquets ==== | ||
+ | <code> | ||
+ | sudo apt remove mon_paquet | ||
+ | </code> | ||
+ | <code> | ||
+ | sudo apt purge mon_paquet | ||
+ | </code> | ||
[[https://doc.ubuntu-fr.org/tutoriel/comment_supprimer_un_paquet]] | [[https://doc.ubuntu-fr.org/tutoriel/comment_supprimer_un_paquet]] | ||
+ | ===== Problèmes ===== | ||
+ | ==== Le fichier de cache des paquets est corrompu ==== | ||
+ | === Symptômes === | ||
+ | <code bash> | ||
+ | admin@admin:~$ sudo apt-get update | ||
+ | Atteint :1 http://fr.archive.ubuntu.com/ubuntu bionic InRelease | ||
+ | Atteint :2 http://fr.archive.ubuntu.com/ubuntu bionic-updates InRelease | ||
+ | Atteint :3 http://security.ubuntu.com/ubuntu bionic-security InRelease | ||
+ | Ign :4 http://download.webmin.com/download/repository sarge InRelease | ||
+ | Atteint :5 http://dl.ubnt.com/unifi/debian stable InRelease | ||
+ | Atteint :6 http://download.webmin.com/download/repository sarge Release | ||
+ | Lecture des listes de paquets... Erreur ! | ||
+ | E: Erreur de lecture - read (5: Input/output error) | ||
+ | W: Vous pouvez lancer « apt-get update » pour corriger ces problèmes. | ||
+ | E: Le fichier de cache des paquets est corrompu | ||
+ | </code> | ||
+ | === Résolution === | ||
+ | |||
+ | |||
+ | <code bash> | ||
+ | sudo rm /var/lib/apt/lists/* -vf // supprime tous les fichiers du dossier apt/lists | ||
+ | sudo apt-get update | ||
+ | </code> | ||
+ | ==== Input/output error ==== | ||
+ | === Symptômes === | ||
+ | |||
+ | <code bash> | ||
+ | Reading package lists... | ||
+ | Building dependency tree... | ||
+ | Reading state information... | ||
+ | ... | ||
+ | (Reading database ... 70% | ||
+ | dpkg: unrecoverable fatal error, aborting: | ||
+ | reading files list for package 'libgssapi3-heimdal:amd64': Input/output error | ||
+ | E: Sub-process /usr/bin/dpkg returned an error code (2) | ||
+ | </code> | ||
+ | === Résolution === | ||
+ | Source -> [[https://askubuntu.com/questions/139377/unable-to-install-any-updates-through-update-manager-apt-get-upgrade]] | ||
+ | |||
+ | >So the solution is the following: | ||
+ | > | ||
+ | >1 - Go into the ''/var/lib/dpkg directory'' | ||
+ | >2 - Make a backup of the status file | ||
+ | >3 - Edit the status file | ||
+ | >4 - Search the package that gave the error | ||
+ | >5 - Just delete the lines from this package (but let all other lines that concern other >packages even if they contains the broken package in their "Replaces" or "Depends" >fields) | ||
+ | > | ||
+ | >[…] | ||
+ | > | ||
+ | >6 - Save changes in the status file | ||
+ | > | ||
+ | >7 - Run: ''sudo dpkg --configure -a'' | ||
+ | >Force the re-installation of missing dependencies (because now, there are some): | ||
+ | > | ||
+ | >8 - ''sudo apt-get -f install'' | ||
+ | >I think that if the broken package does not depend on any other package (could be >rare), just reinstall it: | ||
+ | > | ||
+ | >9 - ''sudo apt-get install %the_package%'' | ||
+ | >Everything is fine now can update, upgrade, or install new packages! | ||
+ | |||
+ | |||
+ | |||
+ | |||