I am unable to erase the m2 board of M2RET and install Arduino IDE. I get a avrdude: butterfly_recv(): programmer is not responding. message
You don’t have the proper board selected. The M2 is a SAM3X based design but your error is from avrdude which was for the older ATMEGA Arduino boards. You’ll need to make sure you’ve got the Macchina M2 board files installed and selected.