Score:1

E: Sub-process /usr/bin/dpkg returned an error code (1) mysql-server-8.0

us flag

When I installed xdm I got this error but i fixed it with --purge, but now I am installing mysql-server-8.0 and I get this error:

skynet@project-skynet3:/var/cache/apt/archives$ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  mysql-server-8.0
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
27 not fully installed or removed.
1 standard security update
Need to get 0 B/1,282 kB of archives.
After this operation, 1,488 kB 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
dpkg: warning: files list file for package 'mysql-common' missing; assuming package has no files currently installed
(Reading database ... 134655 files and directories currently installed.)
Preparing to unpack .../mysql-server-8.0_8.0.25-0ubuntu0.20.04.1_amd64.deb ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing archive /var/cache/apt/archives/mysql-server-8.0_8.0.25-0ubuntu0.20.04.1_amd64.deb (--unpack):
 new mysql-server-8.0 package pre-installation script subprocess returned error exit status 1
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error while cleaning up:
 new mysql-server-8.0 package post-removal script subprocess returned error exit status 1
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server-8.0_8.0.25-0ubuntu0.20.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

When I delete the .deb file it just reappears after any action I take. I've been stuck at this for hours and really need help, Thanks.

Score:0
in flag

The first step will be to identify which process is locking the config.dat file. You can do so with:

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

So long as the file is still locked, you'll get something like this:

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

If you recognise the command and see that it's running in another Terminal window (or by another process that you know is running), then you will want to wait for the command(s) to complete. If, however, the process is locked up, you can "terminate" it like this:

sudo kill -9 90210

Note: Be sure to replace 90210 with the actual PID reported by the first command.

Alternatively, if you do not care what has a lock on config.dat and you just want to install the software, you can perform both commands together like this:

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

The -k flag will kill any processes that have a lock on the file.

Domenico Valentino avatar
us flag
Thank you sooo much it worked! Really appreciate your response.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.