Resolve dpkg: warning: files list file for package

Keywords: sudo

Resolve dpkg: warning: files list file for package

When installing packages with apt-get install, there is a bunch of warnings; it is suspected that deb packages were previously installed and that forced override of deb resulted from dependency conflicts.

The warnings are as follows (there are nearly 2,000 lines of warnings, depending on missing issues):

dpkg: warning: files list file for package 'xorg-docs-core' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'wine-gecko2.21:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'wine-gecko2.21:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'fonts-tlwg-sawasdee-ttf' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgcc1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libgcc1:i386' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gconf-service-backend' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'plainbox-secure-policy' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gnome-orca' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libreadline6:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'xfonts-base' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'onboard' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libbamf3-2:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'python3-distupgrade' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libxcb-sync-dev:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libwinpr-pool0.1:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'gcr' missing; assuming package has no files currently installed
...
...

Solution: Write a script, install and repair automatically

  • step.1 copies all the warnings and pastes them into a text named warning.txt
  • step.2, in the same folder, wrote the script named autoinstall for automatic installation.
#!/bin/bash
i=1
for package in $(cat warning.txt | grep "dpkg: warning: files list file for package " | grep -Po "'[^']*'" | sed "s/'//g");
do
  echo "No.${i} ==================start intall ${package}==================="
  apt-get install --reinstall "$package" -y;
  #If aptitude is not installed, apt-get --reinstall "$package" can be used.
  i=`expr $i + 1`
done
  • step.3 gives permission $sudo chmod 777 autoinstall
  • step.4 Execution script $sudo. / Autoinstall

Posted by spamyboy on Fri, 04 Oct 2019 00:22:05 -0700