dpkg: peringatan: file daftar file untuk paket 'x' hilang

20

Saya mendapatkan peringatan ini untuk beberapa paket setiap kali saya menginstal paket atau melakukan apa punapt-get upgrade . Tidak yakin apa yang menyebabkannya; ini adalah instalasi Debian baru di server OpenVZ saya dan saya belum mengubah pengaturan dpkg.

Ini sebuah contoh:

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

Semuanya berfungsi dengan baik, tetapi pesan peringatan ini cukup mengganggu. Adakah yang tahu bagaimana saya bisa memperbaikinya?

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
Menandai
sumber
ls -la /var/lib/dpkg/info | grep libssh?
quanta
Menambahkan keluaran ke pertanyaan.
Mark
Apakah Anda mencoba yang sederhana apt-get update?
Ben Lessani - Sonassi
Ya, saya telah menginstal banyak paket dan menjalankan pembaruan beberapa kali.
Mark

Jawaban:

18

Dia memperbaikinya menginstal ulang file yang muncul di sana. Jadi, Anda mungkin ingin mencoba sesuatu seperti ini:

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

Salin-tempel ramah dalam satu baris:

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

Perlu diketahui, bahwa menjalankan perintah ini membutuhkan waktu , karena kami menggilir setiap paket.

Dalam beberapa kasus apt upgradetidak menunjukkan kesalahan karena itu Anda dapat menginstal ulang satu paket (misalnya x) yang memberikan kesalahan dan jalankan seperti ini:

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
exic
sumber
-bash: syntax error near unexpected token ``do'. Tidak pandai bash; bisakah kamu memperbaikinya?
Mark
Mark: Tidak apa-apa di sini, mungkinkah Anda melewatkan awal forpada baris sebelumnya?
exic
Sayangnya ini tidak melakukan apa pun untuk saya saat menjalankan perintah. Tapi saya suka idee
Jamie Hutber
1
skrip tidak cukup berfungsi, namun gagasan untuk menginstal ulang melakukan trik sudo apt-get install - install ulang "nama paket"
AllGamer
jalankan dulu sudo bashlalu tempel skrip
Soliman
7

Jawaban di atas tidak bekerja untuk saya sepenuhnya. Beberapa paket, yaitu libc6, masih menunjukkan kesalahan ini.

Saya menemukan solusi di satu forum. Bug adalah bahwa versi baru libc tidak menggema daftar file untuk memperbaiki file. Alih-alih menggemakannya /var/lib/dpkg/info/libc6:amd64.listjustru menggemakannya/var/lib/dpkg/info/libc6.list

Itu dapat diperbaiki dengan menjalankan (sesuaikan untuk versi terbaru dan lengkungan libc6 Anda):

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

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

Semoga beruntung bagi siapa pun yang akan membaca ini di masa depan dan menemukannya dapat digunakan.

dzhi
sumber
Tidak berfungsi, jika dpkg-deb -c /var/cache/apt/archives/libc6_2.13-38_amd64.debmemiliki entri dengan tautan simbolis, mis. dpkg-deb -c /var/cache/apt/archives/mc_3%3a4.8.13-3_amd64.deb | grep mc.cshMengembalikan./usr/share/mc/bin/mc.csh -> ../../../lib/mc/mc.csh
AB
@ AB Tidak akan tahu. Saya membuang Debian dan pergi sepenuhnya FreeBSD di mana pun saya bisa.
dzhi
2

Coba simpan skrip ini:

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

Kemudian, jalankan dengan

sudo /bin/bash ./scriptname

Ini butuh sedikit kerja ekstra dan beberapa perintah lain juga suka

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

bersamaan dengan menghapus dan menginstal ulang beberapa paket tertentu.

Ini membutuhkan sedikit waktu dan usaha, masih apt-getakan menunjukkan beberapa kesalahan.

pengguna308018
sumber
1

Tidak cukup rep untuk berkomentar : @exic / @mark, saya menemukan bahwa ia menggunakan backtick di awal nama paket dan tanda kutip sesudahnya, sehingga tanda baca yang berbeda perlu diperiksa. Saya tidak yakin apakah ini terkait. Solusi saya:

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

Salin pesan kesalahan ke file, misalnya 111.txt. Kemudian jalankan perintah

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
pengguna259719
sumber
0

Semua jawaban lain di sini berasumsi bahwa Anda ingin menginstal ulang paket. Dalam kasus saya, saya tidak ingin melakukannya. Saya pernah locatemencoba untuk menghapus semua jejak mereka termasuk daftar file yang tepat.

Langkah pertama adalah memastikan paket dihapus menggunakan manajer paket:

sudo apt remove <package list>

Kemudian apt memiliki perintah yang dapat Anda jalankan untuk membersihkannya. Ini akan menghilangkan peringatan sementara masih membiarkan paket dihapus instalasinya:

sudo apt autoclean

Sumber pada Ask Ubuntu: File daftar file untuk paket yang hilang

Stephen Ostermiller
sumber
sayangnya ini tidak berhasil untuk saya :(
Hayden Thring
@HaydenThring Paket mana yang memberimu masalah?
Stephen Ostermiller
Ada banyak.
Hayden Thring
Saya mengedit jawaban - Anda harus memastikan Anda menghapusnya terlebih dahulu
Stephen Ostermiller
0

Saya menggunakan sistem operasi deepin linux, saya mengubah perintah di atas untuk bekerja. Saya menggunakan bahasa Cina. for package in $(sed "s/.*\ \(.*\)\ .*/\1/" error.txt); do apt-get install -y --reinstall "$package"; done jika Anda menggunakan bahasa inggris

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

jay
sumber
-1

Tidak pernah mendapatkan salah satu dari perintah di atas berfungsi tetapi ini akhirnya berhasil bagi saya setelah mengeluarkan pesan kesalahan ke file error.txt

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

Semoga ini bisa membantu orang lain.

artsim
sumber