Which MPLAB-X version supports Pickit 2?
What you can do is download the standalone PICKIT2 programming software and use that to manually load the hex file MPLAB generates and program your PIC. That's what I do if I'm using the PICKIT2 with MPLAB-X v3.15.

I haven't tried with Linux though. However, it seems there is a command line tool for Linux here: http://www.microchip.com/DevelopmentTools/ProductDetails.aspx?PartNO=pg164120

Look for the PK2CMD.

A simple guide: http://curuxa.org/en/Program_PICs_with_a_PICkit2_using_the_command_line_on_Linux

I'm curious as to how that goes. On my Linux computer, I use PICKIT3, but it would still be nice to know that the PICKIT2 can be used.