LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 05-10-2006, 03:16 AM   #1
NosLycn
Member
 
Registered: Oct 2004
Posts: 41

Rep: Reputation: 15
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
 
Old 05-10-2006, 05:14 AM   #2
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
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).
 
Old 05-10-2006, 02:19 PM   #3
NosLycn
Member
 
Registered: Oct 2004
Posts: 41

Original Poster
Rep: Reputation: 15
Yes. Debconf is installed.
 
Old 05-10-2006, 02:22 PM   #4
NosLycn
Member
 
Registered: Oct 2004
Posts: 41

Original Poster
Rep: Reputation: 15
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.
 
Old 05-10-2006, 03:09 PM   #5
NosLycn
Member
 
Registered: Oct 2004
Posts: 41

Original Poster
Rep: Reputation: 15
Fixed it!

dpkg --clean-avail
apt-get update

And, we're running again.
 
Old 05-10-2006, 04:16 PM   #6
Simon Bridge
LQ Guru
 
Registered: Oct 2003
Location: Waiheke NZ
Distribution: Ubuntu
Posts: 9,211

Rep: Reputation: 198Reputation: 198
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.
 
Old 09-21-2011, 01:56 PM   #7
privijay
LQ Newbie
 
Registered: Sep 2011
Posts: 1

Rep: Reputation: Disabled
Smile

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)
 
Old 12-12-2011, 02:50 AM   #8
/usr/local
LQ Newbie
 
Registered: Nov 2011
Location: Hamburg, Germany
Distribution: Debian, Ubuntu
Posts: 8

Rep: Reputation: Disabled
Quote:
Originally Posted by privijay View Post
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!
 
  


Reply

Tags
dpkg, error, input, output



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sub-Process /usr/bin/dpkg returned an error code (1) Bookspoppa Debian 39 11-12-2013 01:21 PM
dpkg is dead! error in /var/lib/dpkg/available dezert_fox Debian 4 11-22-2011 10:28 AM
dpkg returned an error code (1) Segmentation fault questionman Debian 6 11-02-2004 12:04 AM
Sub-process /bin/rpm returned an error code (255) during uninstall with synaptic DraaX Linux - Newbie 2 02-10-2004 02:05 AM
Synaptic error: "sub-process /usr/bin/dpkg returned an error code (2)" firefly2442 Linux - Software 3 02-04-2004 06:41 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration