Feasability : YUN--SPI--MEGA, loading sketch in YUN with SPI bus wired


I have a terminal build with YUN and MEGA boards. They communicate using SPI bus.
To update sketch in YUN µcontroler, I have to unplug SPI bus, over way, I got an error message saying that the target signature is wrong (it return the MEGA signature).

It is a pbs because technician has to open terminal unplug bus for each terminal and this for dozens of terminals.

Is their anyway to avoid this ? switching off SPI bus at YUN side ????