Как восстановить испорченные и отсутствующие файлы в Ubuntu 19.04?

Я попытался использовать приведенную ниже команду после установки дебсумов. Я получил список пропавших пакетов, а также те, к которым не было доступа из-за проблем с разрешениями.

$ 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
0
задан 13 May 2019 в 10:20

1 ответ

Я могу сказать вам, что случилось. Но я не могу вам сказать, что это хороший способ исправить это. Проблема в том, что debsums сообщает о файлах с ошибками контрольной суммы на стандартный вывод, где затем проходит конвейер и в конечном итоге становится списком пакетов, который затем отправляется на для переустановки или apt install --reinstall .

Проблема в том, что debsums сообщает о несуществующих файлах как об ошибках, которые выходят из stderr! Кроме того, сообщения об ошибках имеют формат, который трудно разобрать. Правильным решением было бы изменить дебсуммы так, чтобы выводился список пакетов для переустановки. debsums уже знает все, что нужно apt переустановить , запуск вывода через dpkg -S действительно пустая трата времени. Другое решение, немного похожее на Руба Голдберга, заключалось в том, чтобы поместить оболочку 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, потому что он фиксирует изменения в файлах конфигурации, а это означает, что если вы сделаете изменение в файле конфигурации, этот трюк перезапишет эти изменения.

Попробуйте и расскажите, как это работает.

0
ответ дан 26 February 2020 в 10:13

Другие вопросы по тегам:

Похожие вопросы: