LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Input/Output Error; dpkg sub-process /usr/bin/dpkg returned and error code (2) (https://www.linuxquestions.org/questions/linux-software-2/input-output-error%3B-dpkg-sub-process-usr-bin-dpkg-returned-and-error-code-2-a-443352/)

NosLycn 05-10-2006 03:16 AM

Input/Output Error; dpkg sub-process /usr/bin/dpkg returned and error code (2)
 
Good day, all. I never have simple problems. If this ends up being simple, I thank you ahead of time.

dpkg doesn't work on my debian box. It is oldstable/stable/testing/unstable. I go to apt-get anything and I get an error. Here's an example using "joe" as my apt-get install candidate.

Quote:

suna:/home/dave# apt-get install joe
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
libc6 libncurses5 tzdata
Suggested packages:
locales glibc-doc
Recommended packages:
libgpmg1
The following NEW packages will be installed
joe libc6 libncurses5 tzdata
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/5632kB of archives.
After unpacking 18.4MB of additional disk space will be used.
Do you want to continue [Y/n]? y
E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: Bad file descriptordpkg: failed to open package info file `/var/lib/dpkg/available' for reading: Input/output error
E: Sub-process /usr/bin/dpkg returned an error code (2)
Isn't that pretty? So far, as far as I can tell, dpkg appears corrupted, or perhaps there is another utility that isn't working properly. Although, it seems to be dpkg itself. Any suggestions would be very much appreciated.

~Dave

Simon Bridge 05-10-2006 05:14 AM

Code:

The following NEW packages will be installed
joe libc6 libncurses5 tzdata
0 upgraded, 4 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/5632kB of archives.
After unpacking 18.4MB of additional disk space will be used.
Do you want to continue [Y/n]? y
E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: Bad file descriptordpkg: failed to open package info file `/var/lib/dpkg/available' for reading: Input/output error
E: Sub-process /usr/bin/dpkg returned an error code (2)

Well... is debconf installed?

From the dbconf man page:
Quote:

Debconf is a configuration system for Debian packages. For a debconf overview and documentation for sysadmins, see debconf(7) (in the debconf-doc package).

NosLycn 05-10-2006 02:19 PM

Yes. Debconf is installed.

NosLycn 05-10-2006 02:22 PM

Just for kicks, I went out to apt-get install debconf. Here's what happened:

Quote:

suna:/home/dave# apt-get install debconf
Reading package lists... Done
Building dependency tree... Done
The following extra packages will be installed:
debconf-i18n libc6 liblocale-gettext-perl libtext-charwidth-perl
libtext-iconv-perl libtext-wrapi18n-perl perl-base tzdata
Suggested packages:
debconf-doc debconf-utils whiptail dialog gnome-utils
libterm-readline-gnu-perl libgnome2-perl libqt-perl libnet-ldap-perl
libgnome-perl locales glibc-doc
Recommended packages:
apt-utils
The following NEW packages will be installed
debconf debconf-i18n libc6 liblocale-gettext-perl libtext-charwidth-perl
libtext-iconv-perl libtext-wrapi18n-perl perl-base tzdata
0 upgraded, 9 newly installed, 0 to remove and 0 not upgraded.
Need to get 301kB/6088kB of archives.
After unpacking 21.6MB of additional disk space will be used.
Do you want to continue [Y/n]? y
Get: 1 http://debian.yorku.ca etch/main liblocale-gettext-perl 1.05-1 [19.9kB]
Get: 2 http://debian.yorku.ca etch/main libtext-iconv-perl 1.4-2 [14.9kB]
Get: 3 http://debian.yorku.ca etch/main libtext-charwidth-perl 0.04-3 [11.2kB]
Get: 4 http://debian.yorku.ca etch/main libtext-wrapi18n-perl 0.06-4 [8642B]
Get: 5 http://debian.yorku.ca etch/main debconf-i18n 1.5.0 [113kB]
Get: 6 http://debian.yorku.ca etch/main debconf 1.5.0 [133kB]
Fetched 301kB in 4s (75.2kB/s)
E: Cannot get debconf version. Is debconf installed?
debconf: apt-extracttemplates failed: Bad file descriptordpkg: failed to open package info file `/var/lib/dpkg/available' for reading: Input/output error
E: Sub-process /usr/bin/dpkg returned an error code (2)
Neat, eh? See, something that I learned from the last Debian installation I had is that debconf doesn't have to be installed to apt-get install things. dpkg does not depend on debconf. I had a system up and running and had installed xgl and various other things that I don't have now, without debconf. I seriously believe that dpkg is messed up somehow. Nothing will unpack. I always get the input/output error, doing anything.

NosLycn 05-10-2006 03:09 PM

Fixed it!

dpkg --clean-avail
apt-get update

And, we're running again.

Simon Bridge 05-10-2006 04:16 PM

well done.

yeah - debconf isn't required for dpkg to work. Also, the error messages are not always a good indicator of what is wrong.

Even so - first port of call is to check that the error message is off first then look for other issues. In this case, first stop is to check that debconf exists.

Since it does, then dpkg is getting confused about what packages are around and what arn't. Especially likely considering you description of the install in post #1. Cleaning up was the next move - and you got there yourself.

Installing dpkg from source was not indicated since, when something like that gets coruupted it usually fails much more nastily than that.

You did well with a nice progression in reasoning.
Good solve.

privijay 09-21-2011 01:56 PM

Thanks NosLycn... That was very helpful... I ran into the same error today...

Just one correction ..guess it was a typo

its dbkg --clear-avail

(not clean)

/usr/local 12-12-2011 02:50 AM

Quote:

Originally Posted by privijay (Post 4478425)
its dbkg --clear-avail

Well, it's stil dpkg, not dbkg ;-)

So, the line should read

Code:

dpkg --clear-avail
Thanks to all of you!


All times are GMT -5. The time now is 01:02 AM.