dpkg: warning: arquivo da lista de arquivos ausente no pacote 'x'


20

Recebo esse aviso para vários pacotes toda vez que instalo ou realizo qualquer pacote apt-get upgrade. Não tenho certeza do que está causando isso; é uma nova instalação do Debian no meu servidor OpenVZ e não alterei nenhuma configuração do dpkg.

Aqui está um exemplo:

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:~# 

Tudo funciona bem, mas essas mensagens de aviso são bastante irritantes. Alguém sabe como eu posso consertar isso?

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

Saída adicionada à pergunta.
Mark

Você tentou um simples apt-get update?
Ben Lessani - Sonassi

Sim, eu instalei muitos pacotes e executei a atualização várias vezes.
Mark

Respostas:


18

Ele o corrigiu reinstalando os arquivos que apareciam lá. Então, você pode tentar algo assim:

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

Copie e cole de maneira amigável em uma linha:

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

Esteja ciente de que a execução desse comando leva algum tempo , enquanto percorremos todos os pacotes.

Em alguns casos apt upgradenão mostra os erros, portanto, você pode reinstalar um pacote (por exemplo, x) que fornece o erro e executar da seguinte maneira:

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'. Não é bom no bash; você poderia consertar isso?
Mark

Mark: Está tudo bem aqui, poderia ser que você perdeu o começo forda linha anterior?
exic 21/09/12

Infelizmente isso não faz nada para mim enquanto estiver executando o comando. Mas eu amo o ideae #
Jamie Hutber

11
o script não muito trabalho, no entanto, a ideia de reinstalar fez o truque sudo apt-get install --reinstall "nome do pacote"
AllGamer

primeiro execute sudo bashe cole o script
Soliman

7

A resposta acima não funcionou completamente para mim. Alguns pacotes, ou seja, libc6, ainda estavam mostrando esse erro.

Eu encontrei uma solução em um fórum. O bug é que a nova versão do libc não ecoou a lista de arquivos para corrigir o arquivo. Em vez de ecoar para /var/lib/dpkg/info/libc6:amd64.listele ecoou para/var/lib/dpkg/info/libc6.list

Pode ser corrigido executando (ajuste para sua versão mais recente e arco da 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

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

Boa sorte para quem ler isso no futuro e achar útil.


Não funciona, se dpkg-deb -c /var/cache/apt/archives/libc6_2.13-38_amd64.debtiver entradas com links simbólicos, por exemplo, dpkg-deb -c /var/cache/apt/archives/mc_3%3a4.8.13-3_amd64.deb | grep mc.cshretornos./usr/share/mc/bin/mc.csh -> ../../../lib/mc/mc.csh
AB

@AB Não saberia. Eu abandonei o Debian e fui totalmente FreeBSD onde eu pudesse.
dzhi

2

Tente salvar este 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

Em seguida, execute-o com

sudo /bin/bash ./scriptname

Isso exigiu um pouco de trabalho extra e alguns outros comandos também, como

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

juntamente com a remoção e reinstalação de alguns pacotes específicos.

Isso leva um pouco de tempo e esforço, mas ainda apt-getassim mostramos alguns erros.


1

Representante insuficiente para comentar : @exic / @mark, descobri que ele usa um backtick no início do nome do pacote e uma citação depois; portanto, pontuação diferente precisa ser verificada. Não tenho certeza se isso foi relacionado. Minha solução:

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

0

Copie a mensagem de erro para um arquivo, por exemplo 111.txt. Em seguida, execute o comando

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

Todas as outras respostas aqui assumem que você deseja reinstalar os pacotes. No meu caso, eu não queria fazer isso. Eu costumava locatetentar remover todos os vestígios deles, incluindo suas listas de arquivos apt.

A primeira etapa é garantir que os pacotes sejam removidos usando o gerenciador de pacotes:

sudo apt remove <package list>

Então o apt tem um comando que você pode executar para limpá-lo. Isso eliminará o aviso e ainda deixará os pacotes desinstalados:

sudo apt autoclean

Fonte no Ask Ubuntu: arquivo da lista de arquivos com falta de pacote


infelizmente isso não funcionou para mim :(
Hayden Thring

@HaydenThring Qual pacote está lhe causando problemas?
Stephen Ostermiller

há um monte.
Hayden Thring

Eu editei a resposta - você tem que ter certeza que você removê-los primeiro
Stephen Ostermiller

0

Eu uso o sistema operacional deepin linux, alterei os comandos acima para funcionar. Eu uso o idioma chinês. for package in $(sed "s/.*\ \(.*\)\ .*/\1/" error.txt); do apt-get install -y --reinstall "$package"; done se você usa inglês

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


-1

Nunca tive nenhum dos comandos acima para funcionar, mas isso finalmente funcionou para mim depois de enviar a mensagem de erro para o arquivo error.txt

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

Espero que isso ajude mais alguém.

Ao utilizar nosso site, você reconhece que leu e compreendeu nossa Política de Cookies e nossa Política de Privacidade.
Licensed under cc by-sa 3.0 with attribution required.