安装 debsums 后,我尝试使用以下命令。我得到了缺失软件包的列表以及由于权限问题而无法访问的软件包的列表。
$ apt-get install --reinstall $(dpkg -S $(debsums -c) | cut -d : -f 1 | sort -u)
debsums: missing file /usr/share/locale/aa/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/af/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/am/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/an/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ar/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ast/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/az/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/be/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/bg/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/bn/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/br/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/bs/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ca/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ckb/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/cs/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/csb/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/cy/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/da/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/de/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/dv/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/el/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/eo/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/es/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/et/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/eu/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/fa/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/fi/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/fo/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/fr/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/fur/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/fy/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ga/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/gd/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/gl/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/gu/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/gv/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/he/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/hi/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/hr/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ht/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/hu/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/hy/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/id/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/is/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/it/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ja/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ka/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/kk/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/kl/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/km/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/kn/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ko/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ku/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/kw/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ky/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/lb/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/lt/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/lv/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/mg/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/mhr/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/mi/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/mk/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ml/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/mr/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ms/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/my/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/nb/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/nds/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ne/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/nl/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/nn/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/nso/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/oc/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/pa/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/pl/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/pt/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/pt_BR/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ro/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ru/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/sc/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/sd/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/se/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/shn/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/si/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/sk/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/sl/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/sn/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/sq/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/sr/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/sv/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/sw/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ta/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ta_LK/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/te/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/tg/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/th/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/tl/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/tr/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/tt/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ug/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/uk/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/ur/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/uz/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/vi/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/wae/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/zh_CN/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/zh_HK/LC_MESSAGES/example-content.mo (from example-content package)
debsums: missing file /usr/share/locale/zh_TW/LC_MESSAGES/example-content.mo (from example-content package)
debsums: can't open flatpak file /var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.Flatpak.pkla (Permission denied)
debsums: can't open fwupd file /var/lib/polkit-1/localauthority/10-vendor.d/fwupd.pkla (Permission denied)
debsums: can't open geoclue-2.0 file /var/lib/polkit-1/localauthority/10-vendor.d/geoclue-2.0.pkla (Permission denied)
debsums: can't open linux-image-5.0.0-13-generic file /boot/vmlinuz-5.0.0-13-generic (Permission denied)
debsums: can't open linux-image-5.0.0-14-generic file /boot/vmlinuz-5.0.0-14-generic (Permission denied)
debsums: can't open linux-modules-5.0.0-13-generic file /boot/System.map-5.0.0-13-generic (Permission denied)
debsums: can't open linux-modules-5.0.0-14-generic file /boot/System.map-5.0.0-14-generic (Permission denied)
debsums: can't open network-manager file /var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.NetworkManager.pkla (Permission denied)
debsums: can't open packagekit file /var/lib/polkit-1/localauthority/10-vendor.d/org.freedesktop.packagekit.pkla (Permission denied)
debsums: can't open policykit-desktop-privileges file /var/lib/polkit-1/localauthority/10-vendor.d/com.ubuntu.desktop.pkla (Permission denied)
debsums: missing file /usr/share/man/de/man8/pppconfig.8.gz (from pppconfig package)
debsums: missing file /usr/share/man/fr/man8/pppconfig.8.gz (from pppconfig package)
debsums: missing file /usr/share/man/pt/man8/pppconfig.8.gz (from pppconfig package)
debsums: missing file /usr/share/man/cs/man1/sensible-editor.1.gz (from sensible-utils package)
debsums: missing file /usr/share/man/de/man1/sensible-editor.1.gz (from sensible-utils package)
debsums: missing file /usr/share/man/es/man1/sensible-editor.1.gz (from sensible-utils package)
debsums: missing file /usr/share/man/fr/man1/sensible-editor.1.gz (from sensible-utils package)
debsums: missing file /usr/share/man/it/man1/sensible-editor.1.gz (from sensible-utils package)
debsums: missing file /usr/share/man/ja/man1/sensible-editor.1.gz (from sensible-utils package)
debsums: missing file /usr/share/man/pl/man1/sensible-editor.1.gz (from sensible-utils package)
debsums: missing file /usr/share/man/pt/man1/sensible-editor.1.gz (from sensible-utils package)
debsums: can't open systemd file /var/lib/polkit-1/localauthority/10-vendor.d/systemd-networkd.pkla (Permission denied)
debsums: missing file /usr/share/locale/cs/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/da/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/de/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/es/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/fr/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/gl/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/hu/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/id/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/it/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/lt/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/pl/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/pt_BR/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/sk/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/sr/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/sv/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/tr/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/uk/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/zh_CN/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/zh_TW/LC_MESSAGES/xdg-desktop-portal.mo (from xdg-desktop-portal package)
debsums: missing file /usr/share/locale/cs/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/da/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/de/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/es/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/fr/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/gl/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/hu/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/id/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/it/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/lt/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/pl/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/pt_BR/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/sk/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/sr/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/sv/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/tr/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/uk/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/zh_CN/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
debsums: missing file /usr/share/locale/zh_TW/LC_MESSAGES/xdg-desktop-portal-gtk.mo (from xdg-desktop-portal-gtk package)
dpkg-query: error: --search needs at least one file name pattern argument
答案1
我可以告诉你哪里出了问题。但我不能告诉你一个修复它的好方法。问题是 会将debsums
校验和失败的文件报告到 stdout,然后通过管道最终变成一个包列表,然后发送到apt reinstall
或apt install --reinstall
。
问题是,它debsums
会将不存在的文件报告为错误,这些错误会通过 stderr 输出!此外,错误消息的格式很难解析。正确的解决方案是修改 debsums,使其输出要重新安装的软件包列表。debsums 已经知道了所需的一切apt reinstall
,运行输出dpkg -S
真的是浪费时间。另一个解决方案有点鲁布·戈德堡风格,就是在 debsums 周围放置一个 python 包装器,以便它将来自 stderr 和 stdout 的信息合并到软件包列表中。
所以做完研究后,我发现了一个出奇简单的方法:发送到 stderr 的信息比发送到 stdout 的信息更有用。
debsums -s -a 2> /tmp/broken.log
apt reinstall $(cut -d " " -f 6 < /tmp/broken.log | fgrep -v md5sums | sort -u)
回想起来,最好避免使用 -a 开关,因为它会捕获配置文件中的更改,这意味着如果您更改配置文件,此技巧将覆盖这些更改。
尝试一下然后告诉我效果如何。