dpkg 740 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh
  2. . /lib/recovery-mode/l10n.sh
  3. if [ "$1" = "test" ]; then
  4. echo $(eval_gettext "Repair broken packages")
  5. exit 0
  6. fi
  7. # do some cleanup
  8. rm -f /var/lib/apt/lists/partial/*
  9. rm -f /var/cache/apt/archives/partial/*
  10. # check and use dist-upgraders partial mode if we have it,
  11. # it contains a lot of useful repair code
  12. script=/usr/lib/python3/dist-packages/DistUpgrade/dist-upgrade.py
  13. if [ -e $script ]; then
  14. env RELEASE_UPGRADER_NO_SCREEN=1 python3 "$script" --partial --frontend DistUpgradeViewText \
  15. --datadir /usr/share/ubuntu-release-upgrader
  16. else
  17. dpkg --configure -a
  18. apt-get update
  19. apt-get install -f
  20. apt-get dist-upgrade
  21. fi
  22. echo ""
  23. echo $(eval_gettext "Finished, please press ENTER")
  24. read TMP
  25. exit 0