简体   繁体   English

dpkg卡在阅读数据库中

[英]dpkg stuck in reading database

when trying to install something through apt-get or using dpkg -i to install a deb file the process gets stuck in reading the database. 当尝试通过apt-get安装或使用dpkg -i安装deb文件时,进程在读取数据库时陷入困境。 The last lines of the output read as follows: 输出的最后几行如下:

Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 

Then no progress at all. 然后根本没有进展。 I already tried doing various combinations of 我已经尝试过做各种组合了

apt-get update && apt-get upgrade (update works, upgrade fails)
apt-get install -f (doesn't change anything)
dpkg --configure -a (doesn't seem to do anything)
dpkg --clear-avail (same as before)

I also tried using one of the backups of /var/lib/dpkg/status found in /var/backups, but with no success. 我还尝试使用/ var / backups中找到的/ var / lib / dpkg / status备份之一,但没有成功。

I checked the status of every package installed is OK 我检查了每个安装包的状态是否正常

I first noticed the problem when I was running an update. 我在运行更新时首先注意到了这个问题。 I'm using Ubuntu 14.04 which has dpkg 1.17.5 我使用的是Ubuntu 14.04,其dpkg为1.17.5

Thanks in advance 提前致谢

The following commands make it almost instantaneous: 以下命令几乎可以立即实现:

sudo dpkg --clear-avail
sudo sync-available

sync-available is part of the dctrl-tools package. sync-available是dctrl-tools包的一部分。

I've managed to solve this by overwriting /var/lib/dpkg/ with a backed up version. 我设法通过使用备份版本覆盖/var/lib/dpkg/来解决这个问题。 Thankfully, I regularly make backups. 谢天谢地,我经常做备份。 If you don't have a backup then maybe you can fetch the content of this directory from a live CD. 如果您没有备份,那么您可以从Live CD中获取此目录的内容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM