Hoy, me encontré con el siguiente error cuando intento actualizar mi sistema de escritorio Ubuntu 20.04 LTS.
$ sudo apt upgrade
Salida de muestra:
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.
Lo intenté de nuevo con el administrador de paquetes Graphical Synaptic. ¡Pero sin suerte! ¡Recibí el mismo error!
Este es uno de los problemas comunes en los sistemas basados en Ubuntu y Debian.
Después de leer el resultado con un poco de atención, entendí que las listas de paquetes o el archivo de estado están dañados por algún motivo, por lo que no se pudieron analizar.
Para aquellos que se preguntan, el archivo de estado contiene información sobre los paquetes deb instalados. Podemos resolver este problema eliminando la lista de paquetes dañados y el archivo de estado y regenerarlos como se describe a continuación.
Corregir el error "Encontrado una sección sin paquete:encabezado" en Ubuntu
Paso 1. Primero, elimine la lista de paquetes dañados usando el comando:
$ sudo rm /var/lib/apt/lists/* -vf
El comando anterior eliminará toda la lista de fuentes del paquete de su sistema Ubuntu.
Aquí está el resultado de muestra de mi escritorio 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'
Paso 2. Ahora, ejecute el siguiente comando para reconstruir la lista de fuentes del paquete:
$ sudo apt upgrade
Esto tomará un tiempo dependiendo de su velocidad de Internet. ¡Se paciente!
Paso 3. Una vez que se regenere la lista de paquetes, realice una actualización completa ejecutando los siguientes comandos uno por uno:
$ sudo apt upgrade
$ sudo apt upgrade
$ sudo apt dist-upgrade
Paso 4. Después de actualizar el sistema Ubuntu, borre el caché del paquete:
$ sudo apt autoclean
$ sudo apt autoremove
Paso 5. Finalmente, cierre todos los programas abiertos y reinicie su sistema:
$ sudo reboot
El problema ya debería haber desaparecido.
Paso 6: Por si acaso, si aún ve el mismo error, elimine el archivo de estado y vuelva a generarlo con los siguientes comandos:
$ sudo rm /var/lib/dpkg/status
$ sudo touch /var/lib/dpkg/status
$ sudo apt upgrade
No olvide realizar una actualización completa del sistema y limpiar el caché de apt y luego reiniciar su sistema.
Soluciones a otros problemas comunes en Ubuntu:
- Cómo reparar el sistema operativo Ubuntu roto sin reinstalarlo
- Cómo reparar el error Busybox Initramfs en Ubuntu
- Reparar "El subproceso /usr/bin/dpkg devolvió un código de error (1)" en Ubuntu
- Reparar "W:algunos archivos de índice no se pudieron descargar". Error en Ubuntu
- Corregir el error 'E:El archivo de caché del paquete está dañado, tiene el hash incorrecto' en Ubuntu
- Cómo solucionar el error "E:No se pudo obtener el bloqueo /var/lib/dpkg/lock" en Ubuntu
- Corregir el error “dpkg:error:parsing file ‘/var/lib/dpkg/updates/0014′” en Ubuntu
Espero que esto ayude.