![在 ubuntu 16.04 上运行 sudo apt-get upgrade 时出错](https://linux22.com/image/1022911/%E5%9C%A8%20ubuntu%2016.04%20%E4%B8%8A%E8%BF%90%E8%A1%8C%20sudo%20apt-get%20upgrade%20%E6%97%B6%E5%87%BA%E9%94%99.png)
setting xserver-xorg-legacy/xwrapper/allowed_users from configuration file
dpkg: warning: files list file for package 'libqt5webkit5:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsamplerate0:amd64' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'libsane-hpaio:amd64' missing; assuming package has no files currently installed
dpkg: unrecoverable fatal error, aborting:
files list file for package 'policykit-desktop-privileges' is missing final newline
E: Sub-process /usr/bin/dpkg returned an error code (2)
如何修复?我正在尝试删除该包,但无法删除。
答案1
您必须使用技巧来解决这个问题。删除有问题的文件列表,然后通过以下方式重新安装软件包:
sudo rm /var/lib/dpkg/info/policykit-desktop-privileges.list
sudo apt-get update
sudo apt-get install --reinstall policykit-desktop-privileges
然后修复另外三个提到的软件包
sudo apt-get install --reinstall libqt5webkit5:amd64
sudo apt-get install --reinstall libsamplerate0:amd64
sudo apt-get install --reinstall libsane-hpaio:amd64
然后安装当前版本的所有升级
sudo apt-get upgrade # upgrade packages
sudo apt-get dist-upgrade # upgrade packages with all new dependencies
然后考虑升级到评论中建议的 18.04 LTS。