1. I haven't seen you for a while.

2. I haven't seen you in a while.
3. I haven't seen you for ages.
4. I haven't seen you in ages.
5. I haven't seen you for a long time.
------------
Are they all grammatical and the same?

Yes, and yes!!

Yes, all five sentences are grammatically correct and express the same general meaning. They convey the idea that the speaker has not had any recent encounters with the person they are addressing. The phrases "for a while," "in a while," "for ages," "in ages," and "for a long time" are all idiomatic expressions that are commonly used interchangeably in casual conversation.