Unbale to install packages in ubuntu 20.04 [duplicate]

I'm trying to install the flashybrid but when I enter the apt-get install flashybrid command, I get this error:

root@user-desktop:/home/user# apt-get install flashybrid
Reading package lists... Done
Building dependency tree
Reading state information... Done
flashybrid is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0B of additional disk space will be used.
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
Setting up flashybrid (0.15+nmu2) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing flashybrid (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
flashybrid
E: Sub-process /usr/bin/dpkg returned an error code (1)

I also tried this one to find what is already using that file:

root@user-desktop:/home/user# lsof | grep /var/cache/debconf/config.dat
lsof: WARNING: can't stat() fuse.gvfs-fuse-daemon file system /home/user/.gvfs
Output information may be incomplete.
dpkg-prec 4672 root 4rW REG 8,6 39658 1697827 /var/cache/debconf/config.dat

But I don't know how to fix this.


Solution 1:

A solution to this locking problem is detailed in the wiki:

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

Will show you what process is holding the lock:

                     USER        PID ACCESS COMMAND
/var/cache/debconf/config.dat:
                     root      18210 F.... dpkg-preconfigu

Then you simply need to note down the PID and kill it like so:

sudo kill PID
sudo kill -9 PID  # if the first doesn't work

Solution 2:

This is more simple one command

I just did:

sudo rm /var/cache/debconf/*.dat 

After I run the apt-get install and (I was installing curl ) and it worked restored the db manual pages.

PS: I removed something with apt-get and I did have this problem. but solved it simply thank also to @rajagenupula