GNU/Linux >> Tutoriels Linux >  >> Ubuntu

Correction de l'erreur "A rencontré une section sans package :en-tête" dans Ubuntu

Aujourd'hui, j'ai rencontré l'erreur suivante lorsque j'essaie de mettre à jour mon système de bureau Ubuntu 20.04 LTS.

$ sudo apt update

Exemple de résultat :

Get:1 http://ny-mirrors.evowise.com/ubuntu focal InRelease [265 kB]
Hit:2 http://linux.teamviewer.com/deb stable InRelease                                                                                                                   
Hit:3 http://ppa.launchpad.net/costales/yaru-colors-folder-color/ubuntu focal InRelease
Hit:4 http://ny-mirrors.evowise.com/ubuntu focal-updates InRelease  
Hit:5 http://ny-mirrors.evowise.com/ubuntu focal-backports InRelease
Hit:6 http://ny-mirrors.evowise.com/ubuntu focal-security InRelease
Hit:7 http://dl.google.com/linux/chrome/deb stable InRelease
Fetched 265 kB in 3s (99.8 kB/s)
Reading package lists... Error!
E: Encountered a section with no Package: header
E: Problem with MergeList /var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_universe_binary-i386_Packages
E: The package lists or status file could not be parsed or opened.

J'ai réessayé avec le gestionnaire de paquets Graphical Synaptic. Mais pas de chance ! J'ai la même erreur !

C'est l'un des problèmes courants dans les systèmes basés sur Ubuntu et Debian.

Après avoir lu un peu attentivement la sortie, j'ai compris que les listes de packages ou le fichier d'état étaient corrompus pour une raison quelconque, de sorte qu'ils ne pouvaient pas être analysés.

Pour ceux qui se demandent, le fichier d'état contient les informations sur les packages deb installés. Nous pouvons résoudre ce problème en supprimant la liste des packages endommagés et le fichier d'état et en les régénérant comme décrit ci-dessous.

Correction de l'erreur « A rencontré une section sans package :en-tête » dans Ubuntu

Étape 1. Tout d'abord, supprimez la liste des packages endommagés à l'aide de la commande :

$ sudo rm /var/lib/apt/lists/* -vf

La commande ci-dessus supprimera toute la liste des sources de packages de votre système Ubuntu.

Voici l'exemple de sortie de mon bureau Ubuntu 20.04 LTS :

rm: cannot remove '/var/lib/apt/lists/auxfiles': Is a directory
removed '/var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_InRelease'
removed '/var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_main_binary-amd64_Packages'
removed '/var/lib/apt/lists/linux.teamviewer.com_deb_dists_stable_InRelease'
removed '/var/lib/apt/lists/linux.teamviewer.com_deb_dists_stable_main_binary-amd64_Packages'
removed '/var/lib/apt/lists/linux.teamviewer.com_deb_dists_stable_main_binary-i386_Packages'
removed '/var/lib/apt/lists/lock'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-backports_Contents-amd64.lz4'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-backports_Contents-i386.lz4'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-backports_InRelease'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-backports_main_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-backports_multiverse_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-backports_restricted_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-backports_universe_binary-amd64_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-backports_universe_binary-i386_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-backports_universe_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-backports_universe_dep11_Components-amd64.yml.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-backports_universe_dep11_icons-48x48.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-backports_universe_dep11_icons-64x64.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-backports_universe_i18n_Translation-en'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_Contents-amd64.lz4'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_Contents-i386.lz4'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_InRelease'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_main_binary-amd64_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_main_binary-i386_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_main_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_main_dep11_Components-amd64.yml.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_main_dep11_icons-48x48.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_main_dep11_icons-64x64.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_main_i18n_Translation-en'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_multiverse_binary-amd64_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_multiverse_binary-i386_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_multiverse_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_multiverse_dep11_Components-amd64.yml.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_multiverse_dep11_icons-48x48.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_multiverse_dep11_icons-64x64.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_multiverse_i18n_Translation-en'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_restricted_binary-amd64_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_restricted_binary-i386_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_restricted_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_restricted_i18n_Translation-en'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_Contents-amd64.lz4'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_Contents-i386.lz4'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_InRelease'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_main_binary-amd64_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_main_binary-i386_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_main_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_main_dep11_Components-amd64.yml.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_main_dep11_icons-48x48.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_main_dep11_icons-64x64.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_main_i18n_Translation-en'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_multiverse_binary-amd64_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_multiverse_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_multiverse_i18n_Translation-en'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_restricted_binary-amd64_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_restricted_binary-i386_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_restricted_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_restricted_i18n_Translation-en'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_universe_binary-amd64_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_universe_binary-i386_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_universe_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_universe_dep11_Components-amd64.yml.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_universe_dep11_icons-48x48.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_universe_dep11_icons-64x64.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-security_universe_i18n_Translation-en'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_universe_binary-amd64_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_universe_binary-i386_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_universe_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_universe_dep11_Components-amd64.yml.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_universe_dep11_icons-48x48.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_universe_dep11_icons-64x64.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal_universe_i18n_Translation-en'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_Contents-amd64.lz4'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_Contents-i386.lz4'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_InRelease'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_main_binary-amd64_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_main_binary-i386_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_main_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_main_dep11_Components-amd64.yml.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_main_dep11_icons-48x48.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_main_dep11_icons-64x64.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_main_i18n_Translation-en'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_multiverse_binary-amd64_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_multiverse_binary-i386_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_multiverse_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_multiverse_dep11_Components-amd64.yml.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_multiverse_dep11_icons-48x48.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_multiverse_dep11_icons-64x64.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_multiverse_i18n_Translation-en'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_restricted_binary-amd64_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_restricted_binary-i386_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_restricted_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_restricted_i18n_Translation-en'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_universe_binary-amd64_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_universe_binary-i386_Packages'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_universe_cnf_Commands-amd64'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_universe_dep11_Components-amd64.yml.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_universe_dep11_icons-48x48.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_universe_dep11_icons-64x64.tar.gz'
removed '/var/lib/apt/lists/ny-mirrors.evowise.com_ubuntu_dists_focal-updates_universe_i18n_Translation-en'
rm: cannot remove '/var/lib/apt/lists/partial': Is a directory
removed '/var/lib/apt/lists/ppa.launchpad.net_costales_yaru-colors-folder-color_ubuntu_dists_focal_InRelease'
removed '/var/lib/apt/lists/ppa.launchpad.net_costales_yaru-colors-folder-color_ubuntu_dists_focal_main_binary-amd64_Packages'
removed '/var/lib/apt/lists/ppa.launchpad.net_costales_yaru-colors-folder-color_ubuntu_dists_focal_main_binary-i386_Packages'
removed '/var/lib/apt/lists/ppa.launchpad.net_costales_yaru-colors-folder-color_ubuntu_dists_focal_main_i18n_Translation-en'

Étape 2. Maintenant, exécutez la commande suivante pour reconstruire la liste des sources du package :

$ sudo apt update

Cela prendra un certain temps en fonction de votre vitesse Internet. Être patient!

Étape 3. Une fois la liste des packages régénérée, effectuez une mise à jour complète en exécutant les commandes suivantes une par une :

$ sudo apt update
$ sudo apt upgrade
$ sudo apt dist-upgrade

Étape 4. Après avoir mis à jour le système Ubuntu, effacez le cache du package :

$ sudo apt autoclean
$ sudo apt autoremove

Étape 5. Enfin, fermez tous les programmes ouverts et redémarrez votre système :

$ sudo reboot

Le problème devrait être résolu maintenant.

Étape 6 : Juste au cas où vous voyez toujours la même erreur, supprimez le fichier d'état et reconstruisez-le à l'aide des commandes suivantes :

$ sudo rm /var/lib/dpkg/status
$ sudo touch /var/lib/dpkg/status
$ sudo apt update

N'oubliez pas d'effectuer une mise à jour complète du système et de nettoyer le cache apt, puis de redémarrer votre système.

Solutions à d'autres problèmes courants dans Ubuntu :

  • Comment réparer le système d'exploitation Ubuntu cassé sans le réinstaller
  • Comment réparer l'erreur Busybox Initramfs sur Ubuntu
  • Correction "Le sous-processus /usr/bin/dpkg a renvoyé un code d'erreur (1)" dans Ubuntu
  • Correction "W :Échec du téléchargement de certains fichiers d'index." Erreur dans Ubuntu
  • Correction 'E :Le fichier de cache du package est corrompu, il a le mauvais hachage' Erreur dans Ubuntu
  • Comment réparer l'erreur "E :Impossible d'obtenir le verrou /var/lib/dpkg/lock" sur Ubuntu
  • Correction de l'erreur "dpkg :erreur :analyse du fichier '/var/lib/dpkg/updates/0014′" dans Ubuntu

J'espère que cela vous aidera.


Ubuntu
  1. Fix FirewallD n'exécute pas d'erreur sur Ubuntu 11.10

  2. Comment réparer l'erreur de mise à jour d'Ubuntu :problème avec MergeList

  3. Installez Java sur Ubuntu 20.04 avec le gestionnaire de packages apt

  4. "Erreur de démarrage" avec l'usb en direct d'Ubuntu 15.10 - Comment y remédier

  5. Comment réparer Ubuntu ne peut pas trouver un paquet

Comment réparer l'erreur Busybox Initramfs sur Ubuntu

Comment réparer l'erreur "Impossible de localiser le paquet" dans les distributions Ubuntu ou Debian - (6 solutions en 2022}

Le correctif n'a pas pu télécharger l'erreur de fichiers de package dans Ubuntu

Correction de l'erreur "Échec de la récupération" avec Google Chrome sur Ubuntu et Linux Mint

Correction de l'erreur NO_PUBKEY d'installation de Docker sur Ubuntu 20.04 LTS

Comment réparer l'erreur Apt-Get GPG NO_PUBKEY Ubuntu 14