Input/Output Error; dpkg sub-process /usr/bin/dpkg returned and error code (2)
Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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).
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.