首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >dpkg错误: debconf: DbDriver "config":/var/cache/debconf/config.dat被另一个进程锁定:资源暂时不可用

dpkg错误: debconf: DbDriver "config":/var/cache/debconf/config.dat被另一个进程锁定:资源暂时不可用
EN

Unix & Linux用户
提问于 2021-02-03 01:12:19
回答 2查看 4.4K关注 0票数 1

当我apt upgrade时,我得到错误处理包错误:

我试过网上提到的常见解决方案。但它被困在了一个循环中。

代码语言:javascript
复制
❯ sudo apt upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 mysql-server-5.7 : PreDepends: mysql-common (>= 5.5) but it is not installed
                    Depends: apparmor (>= 2.10) but it is not installed
                    Depends: mysql-client-5.7 (>= 5.7.32-0ubuntu0.16.04.1) but it is not installed
                    Depends: mysql-common (>= 5.6.22-1~) but it is not installed
                    Depends: mysql-server-core-5.7 (= 5.7.32-0ubuntu0.16.04.1) but it is not installed
                    Recommends: libhtml-template-perl but it is not installed
 phpmyadmin : Depends: libapache2-mod-php or
                       libapache2-mod-phpfilter but it is not installable or
                       php-cgi or
                       php-fpm or
                       php
              Depends: php-mysql but it is not installed or
                       php-mysqli or
                       php-mysqlnd
              Depends: php-json
              Depends: php-common but it is not installed
              Depends: libjs-sphinxdoc (>= 1.0) but it is not installed
              Depends: dbconfig-mysql but it is not installed or
                       dbconfig-no-thanks but it is not installed or
                       dbconfig-common (< 2.0.0) but it is not installed
              Depends: php-gettext
              Depends: php-mbstring
              Depends: php-phpseclib (>= 2.0)
              Recommends: php-gd
              Recommends: mysql-client but it is not installed or
                          mariadb-client but it is not installed or
                          virtual-mysql-client
              Recommends: php-tcpdf but it is not installed
E: Unmet dependencies. Try using -f.

然后我试着:

代码语言:javascript
复制
❯ sudo apt-get install -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  apparmor dbconfig-common dbconfig-mysql libapache2-mod-php libapache2-mod-php7.0
  libapparmor-perl libjs-sphinxdoc libjs-underscore mysql-client-5.7
  mysql-client-core-5.7 mysql-common mysql-server-5.7 mysql-server-core-5.7 php-common
  php-gettext php-mbstring php-mysql php-pear php-phpseclib php-xml php7.0-cli
  php7.0-common php7.0-json php7.0-mbstring php7.0-mysql php7.0-opcache php7.0-readline
  php7.0-xml
Suggested packages:
  apparmor-profiles apparmor-profiles-extra apparmor-docs apparmor-utils mysql-server
  | mariadb-server mailx tinyca php-libsodium php-mcrypt php-gmp
Recommended packages:
  libhtml-template-perl
The following NEW packages will be installed:
  apparmor dbconfig-common dbconfig-mysql libapache2-mod-php libapache2-mod-php7.0
  libapparmor-perl libjs-sphinxdoc libjs-underscore mysql-client-5.7
  mysql-client-core-5.7 mysql-common mysql-server-core-5.7 php-common php-gettext
  php-mbstring php-mysql php-pear php-phpseclib php-xml php7.0-cli php7.0-common
  php7.0-json php7.0-mbstring php7.0-mysql php7.0-opcache php7.0-readline php7.0-xml
The following packages will be upgraded:
  mysql-server-5.7
1 upgraded, 27 newly installed, 0 to remove and 0 not upgraded.
14 not fully installed or removed.
Need to get 20.7 MB/23.2 MB of archives.
After this operation, 131 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
...
Selecting previously unselected package php-phpseclib.
Preparing to unpack .../php-phpseclib_2.0.1-1build1_all.deb ...
Unpacking php-phpseclib (2.0.1-1build1) ...
Processing triggers for man-db (2.7.5-1) ...
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-server-5.7_5.7.33-0ubuntu0.16.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

然后:

代码语言:javascript
复制
❯ sudo dpkg --configure -a
Setting up grub-pc (2.02~beta2-36ubuntu3.29) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package grub-pc (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up tzdata (2021a-0ubuntu0.16.04) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package tzdata (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up samba-common (2:4.3.11+dfsg-0ubuntu0.16.04.32) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package samba-common (--configure):
 subprocess installed post-installation script returned error exit status 1
Setting up openssh-server (1:7.2p2-4ubuntu2.10) ...
debconf: DbDriver "config": /var/cache/debconf/config.dat is locked by another process: Resource temporarily unavailable
dpkg: error processing package openssh-server (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of samba:
 samba depends on samba-common (= 2:4.3.11+dfsg-0ubuntu0.16.04.32); however:
  Package samba-common is not configured yet.
 
dpkg: error processing package samba (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of ubuntu-minimal:
 ubuntu-minimal depends on tzdata; however:
  Package tzdata is not configured yet.
  ...
dpkg: error processing package python-pip-whl (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of nodejs:
 nodejs depends on ca-certificates; however:
  Package ca-certificates is not configured yet.
 
dpkg: error processing package nodejs (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 grub-pc
 tzdata
 samba-common
 openssh-server
 samba
 ubuntu-minimal
 samba-common-bin
 ca-certificates
 python-pip
 software-properties-common
 python-pip-whl
 nodejs

我试着删除这里列出的包

代码语言:javascript
复制
❯ sudo apt-get remove $pkg -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package 'libapache2-mod-php7.0' is not installed, so not removed
Package 'mysql-server' is not installed, so not removed
Package 'php-pear' is not installed, so not removed
Package 'php7.0-cli' is not installed, so not removed
Package 'php7.0-common' is not installed, so not removed
Package 'php7.0-gd' is not installed, so not removed
Package 'php7.0-json' is not installed, so not removed
Package 'php7.0-mysql' is not installed, so not removed
Package 'php7.0-opcache' is not installed, so not removed
Package 'php7.0-readline' is not installed, so not removed
Package 'php7.0-xml' is not installed, so not removed
Package 'php7.0-mbstring' is not installed, so not removed
Package 'php7.0-mcrypt' is not installed, so not removed
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 grub-gfxpayload-lists : Depends: grub-pc (>= 1.99~20101210-1ubuntu2)
 libtcl8.6 : Depends: tzdata but it is not going to be installed
 phpmyadmin : Depends: libapache2-mod-php or
                       libapache2-mod-phpfilter but it is not installable or
                       php-cgi or
                       php-fpm or
                       php
              Depends: php-mysql but it is not going to be installed or
                       php-mysqli or
                       php-mysqlnd
              Depends: php-json
              Depends: php-common but it is not going to be installed
              Depends: libjs-sphinxdoc (>= 1.0) but it is not going to be installed
              Depends: dbconfig-mysql but it is not going to be installed or
                       dbconfig-no-thanks but it is not going to be installed or
                       dbconfig-common (< 2.0.0) but it is not going to be installed
              Depends: php-gettext
              Depends: php-mbstring
              Depends: php-phpseclib (>= 2.0)
              Recommends: php-gd
              Recommends: mysql-client but it is not going to be installed or
                          mariadb-client but it is not going to be installed or
                          virtual-mysql-client
              Recommends: php-tcpdf but it is not going to be installed
 python3-requests : Depends: ca-certificates but it is not going to be installed
 rubygems-integration : Depends: ca-certificates but it is not going to be installed
 ssh-import-id : Depends: ca-certificates but it is not going to be installed
                 Recommends: openssh-server
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

这让我们回到安装步骤。我如何解决这个问题并使用apt-get进行升级?

操作系统:Ubuntu16.04.7 LTS x86_64

壳:鱼3.1.2

EN

回答 2

Unix & Linux用户

发布于 2021-02-03 06:13:25

您的…is locked by another process…很可能是由另一个正在运行的dpkg进程引起的。这可能会从以前失败的包配置运行中遗留下来。

如果您确实没有在另一个窗口中运行dpkgapt等,请查看现有的dpkg进程,并考虑对它们进行kill处理。

代码语言:javascript
复制
$ ps awux | grep dpkg

至于其他错误,这都是由于一个或多个软件包在安装时未能进行配置造成的。如果没有看到实际发生的情况,就不可能找出原因。

如果您确定您不需要这些包,您可以删除它们,直到问题消失。如果由于rm前或后rm脚本中的问题,即使删除包也失败了,您可以在/var/lib/dpkg/info/中找到这些脚本,例如/var/lib/dpkg/info/mysql-server.postrm,并删除它们。显然,这是“核选择”,如果你想把这些包裹留在身边,那是不可取的。如果你要立即重新安装它们的话,应该没问题。

我不推荐你所追求的大规模清除策略。这是太容易删除一些重要的和完全破坏你的安装。集中精力解决单个软件包的安装问题。apt的输出善于告诉你什么取决于什么。按照依赖项来纠正这一点。

为了帮助解决未来的问题,保存安装故障日志。我们无法提供适当的帮助,因为我们无法理解为什么这些包一开始就无法配置。

票数 1
EN

Unix & Linux用户

发布于 2022-02-14 08:31:39

也有这个问题。最后,我的引导分区已满到最后一个字节。一些旧的更新没有被正确删除。手动删除较大和较旧的文件,并重新启动。再起作用

要检查您的(引导)分区大小,请使用像"baobab“https://linux.die.net/man/1/baobab这样的工具。

!在删除文件前,请检查文件名!你可能会搞砸你的系统

票数 0
EN
页面原文内容由Unix & Linux提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://unix.stackexchange.com/questions/632356

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档