软件包丢失的文件列表文件——dpkg 警告

软件包丢失的文件列表文件——dpkg 警告

我想在我的计算机上安装 Open JDK 或 Oracle JDK,但在安装过程中出现错误。错误是:

Selecting previously unselected package oracle-java8-installer.
dpkg: warning: files list file for package 'unity-scope-gourmet' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'unity-scope-guayadeque' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'unity-scope-gmusicbrowser' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'unity-scope-manpages' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'unity-scope-firefoxbookmarks' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'unity-scope-gdrive' missing; assuming package has no files currently installed
dpkg: warning: files list file for package 'unity-scope-home' missing; assuming package has no files currently installed
E: Sub-process /usr/bin/dpkg returned an error code (2)

我在 Google 上搜索并尝试安装/重新安装此软件包。最后我尝试删除 Unity。每次尝试我都会遇到此错误。我正在使用 Xmonad。我该如何修复此问题?

答案1

循环遍历七个包的名称来重新创建每个包的列表文件。

但第一次运行

sudo apt-get autoclean

删除不需要的 DEB /var/cache/apt/archives。这是必要的以下命令可以正常工作。

arch="$(dpkg --print-architecture)"
for p in
  unity-scope-gourmet unity-scope-guayadeque unity-scope-gmusicbrowser
  unity-scope-manpages unity-scope-firefoxbookmarks unity-scope-gdrive
  unity-scope-home
do
    find /var/cache/apt/archives -type f -name "${p}_*_${arch}.deb" -exec dpkg-deb --fsys-tarfile {} \; -quit | tar t | cut -f2- -d. | sed 's|^/$|/.|;s|/$||' | sudo tee "/var/lib/dpkg/info/$p.list" > /dev/null
done
sudo chmod -R a+r /var/lib/dpkg/info

经过一些测试后,命令

sudo apt-get install --reinstall unity-scope-gourmet unity-scope-guayadeque unity-scope-gmusicbrowser unity-scope-manpages unity-scope-firefoxbookmarks unity-scope-gdrive unity-scope-home

也应该有帮助。

答案2

我尝试了 AB 的方法,但使用 unity-scope-devhelp 时遇到了同样的错误。然后,我删除了 /var/lib/dpkg/unity-scope-devhelp.list

有用 :)

相关内容