dpkg: warning: files list file for package

Becod

Member
Feb 11, 2020
26
0
6
25
When I use apt, it will prompt the following information
for example apt install lrzsz
Code:
root@pve:~# apt-get install lrzsz
Reading package lists... Done
Building dependency tree      
Reading state information... Done
Suggested packages:
  minicom
The following NEW packages will be installed:
  lrzsz
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/116 kB of archives.
After this operation, 943 kB of additional disk space will be used.
Selecting previously unselected package lrzsz.
dpkg: warning: files list file for package 'libpve-cluster-api-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'corosync' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'runit-helper' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'vncterm' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'openssh-sftp-server' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libvotequorum8:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libzfs2linux' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'librados2-perl' missing; assuming package has no files currently installed
........
dpkg: warning: files list file for package 'libtinfo6: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 'libfaketime:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libstdc++-8-dev:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libacl1-dev:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libdrm-amdgpu1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libtsan0:amd64' missing; assuming package has no files currently installed
(Reading database ... 41747 files and directories currently installed.)
Preparing to unpack .../lrzsz_0.12.21-10_amd64.deb ...
Unpacking lrzsz (0.12.21-10) ...
Setting up lrzsz (0.12.21-10) ...
Processing triggers for man-db (2.8.5-2) ...
I tried
Code:
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
Code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Fitzeng'
import re
def main():
    fix = open('fix.sh', 'w+')
    for line in open("txt"):
        pkg = re.match(re.compile('''dpkg: warning: files list file for package '(.+)' '''), line)
        if pkg:
            cmd = "sudo apt-get install --reinstall " + pkg.group(1)
            fix.write(cmd + '\n')
if __name__ == "__main__":
    main()
Code:
#!/bin/bash
set -e

# Clean out /var/cache/apt/archives
apt-get clean
# Fill it with all the .debs we need
apt-get --reinstall -dy install $(dpkg --get-selections | grep '[[:space:]]install' | cut -f1)

DIR=$(mktemp -d -t info-XXXXXX)
for deb in /var/cache/apt/archives/*.deb
do
    # Move to working directory
    cd "$DIR"
    # Create DEBIAN directory
    mkdir -p DEBIAN
    # Extract control files
    dpkg-deb -e "$deb"
    # Extract file list, fixing up the leading ./ and turning / into /.
    dpkg-deb -c "$deb" | awk '{print $NF}' | cut -c2- | sed -e 's/^\/$/\/./' > DEBIAN/list
    # Figure out binary package name
    DEB=$(basename "$deb" | cut -d_ -f1)
    # Copy each control file into place
    cd DEBIAN
    for file in *
    do
        cp -a "$file" /var/lib/dpkg/info/"$DEB"."$file"
    done
    # Clean up
    cd ..
    rm -rf DEBIAN
done
rmdir "$DIR"
But the message still appears
 
hi,

can you post the full output of apt update
 
您可以发布完整的输出吗apt update
It's here
Code:
root@pve:~# apt update
Hit:1 https://mirrors.tuna.tsinghua.edu.cn/debian buster InRelease
Hit:2 https://mirrors.tuna.tsinghua.edu.cn/debian buster-updates InRelease
Hit:3 https://mirrors.ustc.edu.cn/proxmox/debian/ceph-nautilus buster InRelease
Hit:4 https://mirrors.ustc.edu.cn/proxmox/debian/pve stretch InRelease       
Hit:5 https://mirrors.tuna.tsinghua.edu.cn/debian buster-backports InRelease
Hit:6 https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates InRelease
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
 
did you install something manually with dpkg -i? when/how did this start happening?

can you try dpkg --configure -a? maybe that fixes it
 
  • Like
Reactions: oguz
You have "stretch" and "buster" repos, this cannot work.

Change all to "buster".
I changed it, but the problem remains
did you install something manually with dpkg -i? when/how did this start happening?

can you try dpkg --configure -a? maybe that fixes it
Yes, I've used dpkg to install many packages.
These phenomena appear when I update QEMU (Customized), but I don't care about it. Instead, I use dpkg to manually update the software package.
 
this looks like your /var/lib/dpkg/info/ directory got corrupted/emptied. it should be regenerated after unpacking the .deb (which is part of installing). can you post the full output of "apt install --reinstall PACKAGE" for one of the packages affected?
 
this looks like your /var/lib/dpkg/info/ directory got corrupted/emptied. it should be regenerated after unpacking the .deb (which is part of installing). can you post the full output of "apt install --reinstall PACKAGE" for one of the packages affected?
I used the following script to fix it, but the problem still remains
Code:
#!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Fitzeng'
import re
def main():
    fix = open('fix.sh', 'w+')
    for line in open("txt"):
        pkg = re.match(re.compile('''dpkg: warning: files list file for package '(.+)' '''), line)
        if pkg:
            cmd = "sudo apt-get install --reinstall " + pkg.group(1)
            fix.write(cmd + '\n')
if __name__ == "__main__":
    main()
Code:
root@pve:/opt/Fix# cat fix.sh
apt-get install --reinstall runit-helper
apt-get install --reinstall openssh-sftp-server
apt-get install --reinstall libc-l10n
apt-get install --reinstall ssh
apt-get install --reinstall openssh-server
......
apt-get install --reinstall libfaketime:amd64
apt-get install --reinstall libstdc++-8-dev:amd64
apt-get install --reinstall libacl1-dev:amd64
apt-get install --reinstall libdrm-amdgpu1:amd64
apt-get install --reinstall libtsan0:amd64
Code:
root@pve:/opt/Fix# ./fix.sh
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/650 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ...
dpkg: warning: files list file for package 'libnet-ssleay-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'python3-pkg-resources' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnetfilter-log1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'perl-modules-5.28' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'automake' missing; assuming package has no files currently installed
......
dpkg: warning: files list file for package 'libalgorithm-merge-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gnupg-utils' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libhttp-message-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'binutils-x86-64-linux-gnu' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'ncurses-term' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'login' missing; assuming package has no files currently installed
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 7388 files and directories currently installed.)
Preparing to unpack .../libpcre3-dev_2%3a8.39-12_amd64.deb ...
Unpacking libpcre3-dev:amd64 (2:8.39-12) over (2:8.39-12) ...
Setting up libpcre3-dev:amd64 (2:8.39-12) ...
Processing triggers for man-db (2.8.5-2) ...
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded.
Need to get 0 B/40.6 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ...
dpkg: warning: files list file for package 'libnet-ssleay-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'python3-pkg-resources' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libnetfilter-log1:amd64' missing; assuming package has no files currently installed
......
dpkg: warning: files list file for package 'libhttp-message-perl' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'binutils-x86-64-linux-gnu' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'ncurses-term' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'login' missing; assuming package has no files currently installed
(Reading database ... 30%
(Reading database ... 35%
(Reading database ... 40%
(Reading database ... 45%
(Reading database ... 50%
(Reading database ... 55%
(Reading database ... 60%
(Reading database ... 65%
(Reading database ... 70%
(Reading database ... 75%
(Reading database ... 80%
(Reading database ... 85%
(Reading database ... 90%
(Reading database ... 95%
(Reading database ... 100%
(Reading database ... 7388 files and directories currently installed.)
Preparing to unpack .../libgcc1_1%3a8.3.0-6_amd64.deb ...
Unpacking libgcc1:amd64 (1:8.3.0-6) over (1:8.3.0-6) ...
Setting up libgcc1:amd64 (1:8.3.0-6) ...
Processing triggers for libc-bin (2.30-4) ...
 
are your .deb files broken/empty? if I remove a '.list' file from /var/lib/dpkg/info and then re-install the package, I get the message exactly once, and then it's gone.
 
are your .deb files broken/empty? if I remove a '.list' file from /var/lib/dpkg/info and then re-install the package, I get the message exactly once, and then it's gone.
It's not empty. It has more than 4K files
Code:
root@pve:~# ls -l /var/lib/dpkg/info| grep "^-" | wc -l
4424
 
the '.list' files in there (or lack thereof) are what triggers the warning..
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!