当我卸载 mysql 时,我意外关闭了终端,sudo apt-get purge mysql*
然后打开新的终端并运行,sudo apt-get upgrade
但在 Ubuntu 中出现错误。
以下是详细错误:
Extracting templates from packages: 100%
Preconfiguring packages ...
/tmp/grub-efi-amd64.config.lyQJMF: 1: /tmp/grub-efi-amd64.config.lyQJMF: dpkg: not found
/tmp/gdm3.config.K21eTR: 23: /tmp/gdm3.config.K21eTR: dpkg: not found
Could not exec dpkg!
E: Sub-process /usr/bin/dpkg returned an error code (100)
我尝试使用 修复错误chmod 755 /usr/bin/dpkg or sudo chmod 755 /usr/bin/dpkg
,但没有效果。还是一样。
输出如下:chmod: cannot access '/usr/bin/dpkg': No such file or directory
运行文件 $(which dpkg) 得到的输出是:
$ file $(which dpkg) Usage: file [-bcEhikLlNnprsvzZ0] [--apple] [--extension] [--mime-encoding] [--mime-type] [-e testname] [-F separator] [-f namefile] [-m magicfiles] file ... file -C [-m magicfiles] file [--help]