When you type the command
which afni
what does it tell you? This should list the directory in which the shell finds the afni binary, and it should be your usr/local/AFNI/bin/linux_glibc22/ directory -- if it is something else, then you have another copy of AFNI in the path somewhere, and that is interfering with things.
For these kind of Unix questions, you will get faster results if you can find someone to talk to at your site who knows Unix or Linux. It is very hard to figure out what your problem is without being able to see your computer setup in detail.
bob cox