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.

Comments

  1. Anonymous25.9.08

    thanks for that, though I use a different distro - I got the gist of how to fix it.

    ReplyDelete
  2. Anonymous16.7.09

    Thanks, that really helped me out!

    ReplyDelete
  3. Anonymous10.12.09

    this solve a great headache for me in in Hardy, thanks a lot !

    ReplyDelete

Post a Comment

Popular posts from this blog

Apple's evaluating a new JVM

Tuning ext4 for performance with emphasis on SSD usage