我在尝试在 Ubuntu 20.04LTS 中安装一些软件包时不知何故陷入了某种奇怪的状态。它说软件包已经安装,然后尝试安装或更新 GRUB。起初它弹出一个紫色屏幕,警告 /dev/sda1 不是 EFI 分区(正确),继续可能会导致启动失败。我说不,它就进入了一个循环,一遍又一遍地询问,直到我关闭终端(ctrl+C 不起作用)。我不得不杀死一些与 apt 相关的进程才能再次使用 apt,然后它坚持让我修复 dpkg 状态:
sudo dpkg --configure -a
Setting up grub-efi-amd64-signed (1.173.2~20.04.1+2.04-1ubuntu47.4) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package grub-efi-amd64-signed (--configure):
installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 1
Setting up freerdp2-x11 (2.2.0+dfsg1-0ubuntu0.20.04.3) ...
Processing triggers for man-db (2.9.1-1) ...
Errors were encountered while processing:
grub-efi-amd64-signed
我第一次运行该命令时,它又陷入了无限循环。我重新启动后,它又出现了上述错误。现在,每当我尝试安装某些东西时,我都会遇到这种情况:
sudo apt-get install freerdp2-x11
Reading package lists... Done
Building dependency tree
Reading state information... Done
freerdp2-x11 is already the newest version (2.2.0+dfsg1-0ubuntu0.20.04.3).
The following packages were automatically installed and are no longer required:
blender-data chromium-codecs-ffmpeg-extra fonts-dejavu gdal-data gstreamer1.0-vaapi libaec0 libarmadillo9 libarpack2 libavdevice58 libblosc1 libcfitsio8 libcharls2 libdap25 libdapclient6v5 libdcmtk14 libepsilon1 libfreexl1 libfwupdplugin1 libfyba0 libgdal26
libgdcm3.0 libgeos-3.8.0 libgeos-c1v5 libgeotiff5 libgstreamer-plugins-bad1.0-0 libhdf4-0-alt libhdf5-103 libjemalloc2 libkmlbase1 libkmldom1 libkmlengine1 libnetcdf15 libodbc1 libogdi4.1 libopenal-data libopenal1 libopencolorio1v5 libopencv-core4.2
libopencv-imgcodecs4.2 libopencv-imgproc4.2 libopencv-videoio4.2 libopenimageio2.1 libopenvdb6.2 libosdcpu3.4.0 libosdgpu3.4.0 libpq5 libproj15 libqhull7 libsocket++1 libspatialite7 libspnav0 libsquish0 libsuperlu5 libsz2 libtbb2 libtinyxml2.6.2v5 liburiparser1
libxerces-c3.2 libxmlb1 libyaml-cpp0.6 odbcinst odbcinst1debian2 proj-bin proj-data shim
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
Setting up grub-efi-amd64-signed (1.173.2~20.04.1+2.04-1ubuntu47.4) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package grub-efi-amd64-signed (--configure):
installed grub-efi-amd64-signed package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
grub-efi-amd64-signed
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
运行sudo apt --fix-broken install
似乎解决了这个问题