I am trying to use a pipeline that uses formatdb command of old BLAST. This option is been replaced by makeblastdb in newer versions of blast+ . I could not find archive for blast to download the old version. I am using CentOS 6.5.

Here is the program, if any body is interested to look at the source code:

https://github.com/chiulab/surpi/blob/master/plot_reads_to_gi.sh
The term you're looking for is "Legacy BLAST" :-)

Here we go: ftp://ftp.ncbi.nlm.nih.gov/blast/executables/release/LATEST/

Also, your source code can be upgraded by modifying

    formatdb -p F -i $3.$2.fasta

to

    makeblastdb -dbtype nucl -in $3.$2.fasta

and

    blastall -p blastn -m 8 -a 1 -b 1 -K 1 -d $3.$2.fasta -i $f -o $f.$2.$3.$4.blastn -e $4 >& $f.$2.$3.$4.error

to

    legacy_blast.pl blastall -p blastn -m 8 -a 1 -b 1 -K 1 -d $3.$2.fasta -i $f -o $f.$2.$3.$4.blastn -e $4 >& $f.$2.$3.$4.error --path /path/to/blast/bin

EDIT: I ***highly*** recommend updating your copy of the code to use blast+. In fact, you could do the modifications and submit a PR, and the repo owner will appreciate it.