dpkg: avertissement: le fichier contenant la liste des fichiers du paquet «x» étant manquant


20

J'obtiens cet avertissement pour plusieurs packages chaque fois que j'installe un package ou que je l' exécute apt-get upgrade. Je ne sais pas ce qui en est la cause; c'est une nouvelle installation de Debian sur mon serveur OpenVZ et je n'ai changé aucun paramètre de dpkg.

Voici un exemple:

root@debian:~# apt-get install cowsay
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Suggested packages:
  filters
The following NEW packages will be installed:
  cowsay
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 21.9 kB of archives.
After this operation, 91.1 kB of additional disk space will be used.
Get:1 http://ftp.us.debian.org/debian/ unstable/main cowsay all 3.03+dfsg1-4 [21.9 kB]
Fetched 21.9 kB in 0s (70.2 kB/s)
Selecting previously unselected package cowsay.
dpkg: warning: files list file for package 'libssh2-1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libkrb5-3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libwrap0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libcap2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpam-ck-connector:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libc6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtalloc2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libselinux1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libp11-kit0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libavahi-client3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libbz2-1.0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpcre3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgpm2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgnutls26:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libavahi-common3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libcroco3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'liblzma5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpaper1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsensors4:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libbsd0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libavahi-common-data:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libss2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libblkid1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libslang2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libacl1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libcomerr2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libkrb5support0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'e2fslibs:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'librtmp0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libidn11:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpcap0.8:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libattr1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libdevmapper1.02.1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'odbcinst1debian2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libexpat1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libltdl7:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libkeyutils1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libcups2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsqlite3-0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libck-connector0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'zlib1g:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnl1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libfontconfig1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libudev0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsepol1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libmagic1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libk5crypto3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libunistring0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgpg-error0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libusb-0.1-4:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpam0g:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libpopt0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgssapi-krb5-2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgeoip1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libcurl3-gnutls:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtasn1-3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libuuid1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgcrypt11:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgdbm3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libdbus-1-3:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsysfs2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libfreetype6:amd64' missing; assuming package has no files currently installed
(Reading database ... 21908 files and directories currently installed.)
Unpacking cowsay (from .../cowsay_3.03+dfsg1-4_all.deb) ...
Processing triggers for man-db ...
Setting up cowsay (3.03+dfsg1-4) ...
root@debian:~# 

Tout fonctionne bien, mais ces messages d'avertissement sont assez ennuyeux. Est-ce que quelqu'un sait comment je peux résoudre ce problème?

ls -la /var/lib/dpkg/info | grep libssh:

-rw-r--r-- 1 root root    327 Sep 21 15:51 libssh2-1.list
-rw-r--r-- 1 root root    359 Aug 15 06:06 libssh2-1.md5sums
-rwxr-xr-x 1 root root    135 Aug 15 06:06 libssh2-1.postinst
-rwxr-xr-x 1 root root    132 Aug 15 06:06 libssh2-1.postrm
-rw-r--r-- 1 root root     20 Aug 15 06:06 libssh2-1.shlibs
-rw-r--r-- 1 root root   4377 Aug 15 06:06 libssh2-1.symbols

ls -la /var/lib/dpkg/info | grep libssh?
quanta

Ajout de la sortie à la question.
Mark

Avez-vous essayé un simple apt-get update?
Ben Lessani - Sonassi

Oui, j'ai installé de nombreux packages et exécuté plusieurs fois la mise à jour.
Mark

Réponses:


18

Il l'a corrigé en réinstallant les fichiers qui y apparaissaient. Donc, vous voudrez peut-être essayer quelque chose comme ceci:

for package in $(apt-get upgrade 2>&1 |\
                 grep "warning: files list file for package '" |\
                 grep -Po "[^'\n ]+'" | grep -Po "[^']+"); do
    apt-get install --reinstall "$package";
done

Copiez-collez facilement sur une seule ligne:

for package in $(apt-get upgrade 2>&1 | grep "warning: files list file for package '" | grep -Po "[^'\n ]+'" | grep -Po "[^']+"); do apt-get install --reinstall "$package"; done

Sachez que l'exécution de cette commande prend un certain temps , car nous parcourons chaque package.

Dans certains cas, apt upgradene montre pas les erreurs, vous pouvez donc réinstaller un package (par exemple x) qui donne l'erreur et exécuter comme ceci:

for package in $(apt-get install --reinstall x 2>&1 |\
             grep "warning: files list file for package '" |\
             grep -Po "[^'\n ]+'" | grep -Po "[^']+"); do
    apt-get install --reinstall "$package";
done

-bash: syntax error near unexpected token ``do'. Pas bon à bash; pourriez-vous s'il vous plaît le réparer?
Mark

Mark: Ça va ici, est-ce que tu as pu manquer le début forde la ligne précédente?
exic

Malheureusement, cela ne fait rien pour moi lorsque je suis aux commandes. Mais j'aime l'idée
Jamie Hutber

1
le script n'a pas tout à fait fonctionné, mais l'idée de réinstaller a fait l'affaire sudo apt-get install --reinstall "package name"
AllGamer

premier lancer sudo bashpuis coller le script
Soliman

7

La réponse ci-dessus n'a pas complètement fonctionné pour moi. Quelques paquets, à savoir libc6, affichaient toujours cette erreur.

J'ai trouvé une solution sur un forum. Le bug est que la nouvelle version de libc n'a pas fait écho à la liste des fichiers à corriger. Au lieu de lui faire /var/lib/dpkg/info/libc6:amd64.listécho, il l'a fait écho à/var/lib/dpkg/info/libc6.list

Il peut être corrigé en exécutant (ajustez pour votre dernière version et arch de libc6):

dpkg-deb -c /var/cache/apt/archives/libc6_2.13-38_amd64.deb | awk {'print $6'} | cut -f2- -d. | sed 's|^/$|/.|' | sed 's|/$||' > /var/lib/dpkg/info/libc6:amd64.list

Source: http://forums.debian.net/viewtopic.php?f=5&t=93201

Bonne chance à quiconque lira ceci à l'avenir et le trouvera utilisable.


Ne fonctionne pas, si dpkg-deb -c /var/cache/apt/archives/libc6_2.13-38_amd64.deba des entrées avec des liens symboliques, par exempledpkg-deb -c /var/cache/apt/archives/mc_3%3a4.8.13-3_amd64.deb | grep mc.csh retours./usr/share/mc/bin/mc.csh -> ../../../lib/mc/mc.csh
AB

@AB Je ne sais pas. J'ai abandonné Debian et suis allé entièrement FreeBSD partout où je le pouvais.
dzhi

2

Essayez d'enregistrer ce script:

for package in $(sudo apt-get install catdoc 2>&1 | grep "warning: files list file for package '" | grep -Po "[^'\n ]+'" | grep -Po "[^']+");
do
  sudo apt-get -y install --reinstall "$package"
done

Ensuite, exécutez-le avec

sudo /bin/bash ./scriptname

Cela a pris un peu de travail supplémentaire et quelques autres commandes aussi bien que comme

sudo apt-get -f install
sudo apt-mark hold packagename
sudo dpkg -r --force-depends packagename

ainsi que la suppression et la réinstallation de certains packages spécifiques.

Cela prend un peu de temps et d'efforts, mais apt-getcela affichera quelques erreurs.


1

Pas assez de représentant pour commenter : @exic / @mark, j'ai trouvé qu'il utilise un backtick au début du nom du package et un guillemet par la suite, donc une ponctuation différente doit être vérifiée. Je ne sais pas si c'était lié. Ma solution:

for package in $(apt-get upgrade 2>&1 | grep "warning: files list file" | sed "s/.*\`//; s/'.*//"); do apt-get install --reinstall "$package"; done

0

Copiez le message d'erreur dans un fichier, par exemple 111.txt. Exécutez ensuite la commande

for package in $(cat 111.txt | grep "warning: files list file" | sed "s/'//g" | sed "s/\`//g"|awk '{print $8}'); do apt-get purge "$package" -y; apt-get install "$package" -y;done

0

Toutes les autres réponses ici supposent que vous souhaitez réinstaller les packages. Dans mon cas, je ne voulais pas le faire. J'avais l'habitude located'essayer de supprimer toutes les traces d'entre eux, y compris leurs listes de fichiers apt.

La première étape consiste à s'assurer que les packages sont supprimés à l'aide du gestionnaire de packages:

sudo apt remove <package list>

Ensuite, apt a une commande que vous pouvez exécuter pour le nettoyer. Cela supprimera l'avertissement tout en laissant les packages désinstallés:

sudo apt autoclean

Source sur Ask Ubuntu: fichier de liste de fichiers pour le paquet manquant


malheureusement, cela n'a pas fonctionné pour moi :(
Hayden Thring

@HaydenThring Quel paquet vous pose problème?
Stephen Ostermiller

theres un tas.
Hayden Thring

J'ai édité la réponse - vous devez vous assurer de les supprimer d'abord
Stephen Ostermiller

0

J'utilise le système d'exploitation deepin linux, j'ai changé les commandes ci-dessus pour qu'elles fonctionnent. J'utilise la langue chinoise. for package in $(sed "s/.*\ \(.*\)\ .*/\1/" error.txt); do apt-get install -y --reinstall "$package"; done si vous utilisez l'anglais

for package in $(sed "s/.*'\(.*\)'.*/\1/" error.txt); do apt-get install -y --reinstall "$package"; done


-1

Je n'ai jamais réussi à utiliser l'une des commandes ci-dessus, mais cela a finalement fonctionné pour moi après avoir généré le message d'erreur dans le fichier error.txt

for package in $("s/.*'\(.*\)'.*/\1/" error.txt); do apt-get install --reinstall "$package"; done

J'espère que cela aide quelqu'un d'autre.

En utilisant notre site, vous reconnaissez avoir lu et compris notre politique liée aux cookies et notre politique de confidentialité.
Licensed under cc by-sa 3.0 with attribution required.