I was trying to install something on my machine using apt-get
but it kept giving an error similar to
failed in buffer_read(fd): files list for package `linux-restricted-modules-2.6.15-23-386': Invalid Argument
I searched the net and the Ubuntu Forums but didn’t arrive on a definitive answer. The reason and the solution is below
(Thanks to C.M. Connelly at http://www.eskimo.com/~c/blog/archive/2003-05.html)
- This happens when there’s some issue with the file list of that particular package in Debian derived distributions, such as Ubuntu.
- The files are stored in
/var/lib/dpkg/info/
- The solution is to regenerate the file list or copy it from a place which has that file
Replacing it with a working copy
- Go into the directory/var/lib/dpkg/info/
- List all files pertaining to that package – for example
root@Azlan:/var/lib/dpkg/info# ls -l linux-restricted-modules-2.6.15-23-386*
?--------- 1 12311 67231 13097 2006-05-19 15:00 linux-restricted-modules-2.6.15-23-386.list
-rwxrwxrwx 1 root root 16844 2006-05-19 04:30 linux-restricted-modules-2.6.15-23-386.md5sums
-rwxrwxrwx 1 root root 86 2006-05-19 04:29 linux-restricted-modules-2.6.15-23-386.postinst
-rwxrwxrwx 1 root root 281 2006-05-19 04:29 linux-restricted-modules-2.6.15-23-386.postrm
- As you can see, the file linux-restricted-modules-2.6.15-23-386.list does not seem to be alright.
- Replace it with a file which you already have in some other machine
Regenerating the file
- If you wish to regenerate the file, then you’d require the original .deb package for it
- You may try searching for it in /var/cache/apt/archives
- Regenerate the file using the command below
dpkg -c /var/cache/apt/archives/linux-restricted-modules-2.6.15-23-386_2.6.15.11-1_i386.deb > /var/lib/dpkg/info/linux-restricted-modules-2.6.15-23-386.list
Ubuntu: dpkg fails with “failed in buffer_read(fd)” « UNIX Administratosphere