Thursday 4 June 2009

Solution: E: Cannot get debconf version. Is debconf installed?

If you ever get this error when running apt-get or aptitude:

E: Cannot get debconf version. Is debconf installed?

Then your go to /var/lib/dpkg/ and make sure the files status, available and diversions are not empty. If they are, copy the corresponding *-old file into the proper file and be happy.


This is how they looked in a cowbuilder chroot of mine which refused to build packages (I highlighted the important zero-ed files):

root@twix:/# cd /var/lib/dpkg/
root@twix:/var/lib/dpkg# ls -l
total 280
drwxr-xr-x 2 root root 4096 Apr 13 2008 alternatives
-rw-r--r-- 2 root root 0 Jun 3 13:46 available
-rw-r--r-- 2 root root 99608 Jun 28 2008 available-old
-rw-r--r-- 2 root root 0 Jun 3 13:46 diversions
-rw-r--r-- 2 root root 2501 Feb 28 2008 diversions-old
drwxr-xr-x 2 root root 32768 Apr 13 2008 info
-rw-r----- 2 root root 0 Dec 10 20:27 lock
drwxr-xr-x 5 root root 4096 May 26 2005 methods
drwxr-xr-x 2 root root 4096 May 26 2005 parts
-rw-r--r-- 2 root root 47 Feb 28 2008 statoverride
-rw-r--r-- 2 root root 0 Feb 28 2008 statoverride-old
-rw-r--r-- 2 root root 0 Jun 3 13:46 status
-rw-r--r-- 2 root root 115966 Jun 28 2008 status-old
drwxr-xr-x 2 root root 4096 Jun 29 2008 updates


Hmm, that looks fixable ...

root@twix:/var/lib/dpkg# cp available-old available
root@twix:/var/lib/dpkg# cp diversions-old diversions
root@twix:/var/lib/dpkg# cp status-old status
root@twix:/var/lib/dpkg# ls -l
total 508
drwxr-xr-x 2 root root 4096 Apr 13 2008 alternatives
-rw-r--r-- 1 root root 99608 Jun 4 16:10 available
-rw-r--r-- 2 root root 99608 Jun 28 2008 available-old
-rw-r--r-- 1 root root 2501 Jun 4 16:10 diversions
-rw-r--r-- 2 root root 2501 Feb 28 2008 diversions-old
drwxr-xr-x 2 root root 32768 Apr 13 2008 info
-rw-r----- 2 root root 0 Dec 10 20:27 lock
drwxr-xr-x 5 root root 4096 May 26 2005 methods
drwxr-xr-x 2 root root 4096 May 26 2005 parts
-rw-r--r-- 2 root root 47 Feb 28 2008 statoverride
-rw-r--r-- 2 root root 0 Feb 28 2008 statoverride-old
-rw-r--r-- 1 root root 115966 Jun 4 16:10 status
-rw-r--r-- 2 root root 115966 Jun 28 2008 status-old
drwxr-xr-x 2 root root 4096 Jun 29 2008 updates


Now it works :-)

1 comment:

Avinash said...

Hi,

It seems the folder available and available-old folders are deleted.