Is it ever mentioned in the movies or the books whether it is possible to vanquish or get rid of a ghost forever?

I am not talking about a ghost somehow moves on by itself, more like an evil ghost being handled by living wizards somehow.