首先这类问题一般是动了/var/lib/dpkg/info

创建一个 warning.txt 把所有的warning复制进去

创建一个run脚本

#!/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;
  #如果没有安装aptitude, 则可以用apt-get --reinstall "$package";
  i=`expr $i + 1`
done
sudo chmod 777 run
sudo ./run