Ok, try this:
Code:
#!/bin/sh
#
# Binpack using first fit decreasing strategy
# -ephemera
binsz=4200000 # in KB
nbins=1
b1=0
mkdir bin1
echo Processing files, please wait...
find . -type f | xargs du | sort -rn | cut -f2 | while read f
do
n=1
while true
do
eval s=\$b$n
z=$(du $f | cut -f1)
m=$(($s + $z))
if [ $m -le $binsz ]; then
echo $(basename $f) "->" $n
eval mv $f bin${n}
eval b${n}=\${m}
break
fi
n=$(($n + 1))
if [ $n -gt $nbins ]; then
eval mkdir bin${n}
nbins=$n
eval b${n}=0
fi
done
done
Assuming all the rpms are in one directory, 'cd' to that directory & run this script.
Once the script is done run 'ls' & see if it worked.