2008-09-11

How to fix: xargs: xargs.c:443: main: Assertion `bc_ctl.arg_max <= (131072-2048)' failed.

This is a known bug in Ubuntu/Hardy that have caused many nasty error messages during several operations. The defective package responsible for this bug is findutils. As there is still no fixed findutils package in Hardy, I took the package from the upcoming Ubuntu release Intrepid. To do so, you have to do the follwing steps:
vim /etc/apt/sources.list

and tell Vim to replace all occurrences of the "hardy" string by "intrepid":

:%s/hardy/intrepid/g
:wq

Now you should have the sources.list of Intrepid.
aptitude update
aptitude install findutils

...installs the fixed Intrepid findutils package.
Change the sources.list back to the Hardy revision:
vim /etc/apt/sources.list
:%s/intrepid/hardy/g
:wq


Now you should have the fixed version of the xargs command, which can be used in one-liners like:
find ~/Desktop | xargs grep -H -I -i -n "Name\[ru\]"

which showed me the following information:
/home/alex/Desktop/.directory:58:Name[ru]=Рабочий стол


So I have searched for the string "Name[ru]" in my Desktop directory and got the corresponding file name with the line number containing this string. ...also a really nice example for the expressiveness of the cmd line UI.