apt 不起作用

apt 不起作用

我尝试使用sudo apt upgrade 这个输出:

lnee@fallback:~$ sudo apt upgrade
[sudo] password for lnee: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  libodbc1
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.
4 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 ca-certificates (20201027ubuntu0.20.04.1) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package ca-certificates (--configure):
 installed ca-certificates package post-installation script subprocess returned error exit status 1
Setting up grub-efi-amd64 (2.04-1ubuntu26.6) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package grub-efi-amd64 (--configure):
 installed grub-efi-amd64 package post-installation script subprocess returned error exit status 1
Setting up anbox-modules-dkms (13) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package anbox-modules-dkms (--configure):
 installed anbox-modules-dkms package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of grub-efi-amd64-signed:
 grub-efi-amd64-signed depends on grub-efi-amd64 | grub-pc; however:
  Package grub-efi-amd64 is not configured yet.
  Package grub-pc is not installed.

dpkg: error processing package grub-efi-amd64-signed (--configure):
 dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
                                                              dpkg: dependency problems prevent processing triggers for shim-signed:
 shim-signed depends on grub-efi-amd64-signed | grub-efi-arm64-signed; however:
  Package grub-efi-amd64-signed is not configured yet.
  Package grub-efi-arm64-signed is not installed.

dpkg: error processing package shim-signed (--configure):
 dependency problems - leaving triggers unprocessed
No apport report written because MaxReports is reached already
                                                              Errors were encountered while processing:
 ca-certificates
 grub-efi-amd64
 anbox-modules-dkms
 grub-efi-amd64-signed
 shim-signed
E: Sub-process /usr/bin/dpkg returned an error code (1)
lnee@fallback:~$ 

答案1

(注意后来发现这个不起作用错误仍然存​​在)所以我首先运行命令

sudo fuser -v /var/cache/debconf/config.dat

我得到了这个

/var/cache/debconf/config.dat:
USER        PID ACCESS COMMAND
root      40970 F.... frontend

因此我获得了进程 id ( 40970) 并将其终止 sudo kill 40970(插入进程 id)。

然后我就这么做了sudo apt upgrade

然后我得到了这个

Configuring grub-efi-amd64 GRUB failed to install to the following devices: /dev/sda2  
Do you want to continue anyway?  
If you do, your computer may not start up properly.  
Writing GRUB to boot device failed - continue? <Yes> <No>

于是我按下了<No>,然后<Ok>我认为它已经修好了。

相关内容