A broken naval support ship that has been stuck at Portsmouth Naval Base for several months is expected to leave soon.