Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. 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.

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

Thanks in advance

like image 932
Patricio Clark Avatar asked Dec 05 '25 14:12

Patricio Clark


1 Answers

The following commands make it almost instantaneous:

sudo dpkg --clear-avail
sudo sync-available

sync-available is part of the dctrl-tools package.

like image 135
Breakfast Serial Avatar answered Dec 07 '25 09:12

Breakfast Serial



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!