dpkg: avviso: file dell'elenco dei file per il pacchetto 'x' mancante


20

Ricevo questo avviso per diversi pacchetti ogni volta che installo qualsiasi pacchetto o eseguo apt-get upgrade. Non sono sicuro di cosa lo stia causando; è una nuova installazione di Debian sul mio server OpenVZ e non ho modificato alcuna impostazione di dpkg.

Ecco un esempio:

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

Tutto funziona bene, ma questi messaggi di avviso sono piuttosto fastidiosi. Qualcuno sa come posso risolvere questo?

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?
maggio

Aggiunto output alla domanda.
Segna il

Hai provato un semplice apt-get update?
Ben Lessani - Sonassi,

Sì, ho installato molti pacchetti e eseguito l'aggiornamento più volte.
Segna il

Risposte:


18

Lo riparò reinstallando i file che apparivano lì. Quindi potresti voler provare qualcosa del genere:

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

Copia e incolla in una riga:

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

Tenere presente che l'esecuzione di questo comando richiede del tempo , poiché si scorre ogni pacchetto.

In alcuni casi apt upgradenon mostra gli errori, quindi è possibile reinstallare un pacchetto (ad esempio x) che fornisce l'errore ed eseguire in questo modo:

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'. Non bravo a bash; potresti per favore aggiustarlo?
Segna il

Mark: Va bene qui, potrebbe essere che ti sei perso l'inizio fordella riga precedente?
exic

Purtroppo questo non fa nulla per me mentre corro al comando. Ma adoro l'idea
Jamie Hutber,

1
lo script non ha funzionato del tutto, tuttavia l'idea di reinstallare ha fatto il trucco sudo apt-get install --reinstall "nome pacchetto"
AllGamer

prima esecuzione sudo bashquindi incolla script
Soliman il

7

La risposta sopra non ha funzionato completamente per me. Un paio di pacchetti, ovvero libc6, mostravano ancora questo errore.

Ho trovato una soluzione su un forum. Il bug è che la nuova versione di libc non faceva eco all'elenco dei file per correggere il file. Invece di riecheggiarlo, lo /var/lib/dpkg/info/libc6:amd64.listfece eco/var/lib/dpkg/info/libc6.list

Può essere risolto eseguendo (aggiusta per l'ultima versione e arco di 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

Buona fortuna a chiunque leggerà questo in futuro e lo troverà utilizzabile.


Non funziona, se dpkg-deb -c /var/cache/apt/archives/libc6_2.13-38_amd64.debha voci con collegamenti simbolici, ad es. dpkg-deb -c /var/cache/apt/archives/mc_3%3a4.8.13-3_amd64.deb | grep mc.cshRitorni./usr/share/mc/bin/mc.csh -> ../../../lib/mc/mc.csh
AB

@AB Non lo saprei. Ho lasciato Debian e sono andato interamente su FreeBSD dove ho potuto.
dzhi,

2

Prova a salvare questo 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

Quindi, eseguilo con

sudo /bin/bash ./scriptname

Ciò ha richiesto un po 'di lavoro extra e anche alcuni altri comandi, come piace

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

insieme a rimuovere e reinstallare alcuni pacchetti specifici.

Questo richiede un bel po 'di tempo e fatica, ma comunque apt-getmostrerà alcuni errori.


1

Rappresentante insufficiente per commentare : @exic / @mark, ho scoperto che utilizza un backtick all'inizio del nome del pacchetto e successivamente un virgolette, quindi è necessario controllare la punteggiatura diversa. Non sono sicuro che questo fosse correlato. La mia soluzione:

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

0

Copia il messaggio di errore in un file, ad esempio 111.txt. Quindi eseguire il 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

Tutte le altre risposte qui presuppongono che si desideri reinstallare i pacchetti. Nel mio caso, non volevo farlo. Avevo locatecercato di rimuovere tutte le tracce, compresi i loro elenchi di file apt.

Il primo passo è assicurarsi che i pacchetti vengano rimossi usando il gestore pacchetti:

sudo apt remove <package list>

Quindi apt ha un comando che puoi eseguire per pulirlo. Questo eliminerà l'avviso lasciando comunque i pacchetti disinstallati:

sudo apt autoclean

Sorgente su Ask Ubuntu: file elenco file per pacchetto mancante


sfortunatamente questo non ha funzionato per me :(
Hayden Thring,

@HaydenThring Quale pacchetto ti dà problemi?
Stephen Ostermiller,

c'è un mucchio.
Hayden Thring,

Ho modificato la risposta - devi assicurarti di rimuoverli prima
Stephen Ostermiller il

0

Uso il sistema operativo deepin linux, ho cambiato i comandi sopra per funzionare. Uso la lingua cinese. for package in $(sed "s/.*\ \(.*\)\ .*/\1/" error.txt); do apt-get install -y --reinstall "$package"; done se usi l'inglese

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


-1

Non ho mai fatto funzionare nessuno dei comandi precedenti, ma alla fine ha funzionato per me dopo aver inviato il messaggio di errore al file error.txt

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

Spero che aiuti qualcun altro.

Utilizzando il nostro sito, riconosci di aver letto e compreso le nostre Informativa sui cookie e Informativa sulla privacy.
Licensed under cc by-sa 3.0 with attribution required.