[HowTo] Scripts for using Xbox Controller in RetrOSMC

Retropie 4.0 just released :

NOTE: Some people have been having trouble with the XBox/XBox 360 controller driver xboxdrv on the current Raspbian Kernel. To work around this we now include the latest xpad kernel driver with the image (it is available from the Packages → Drivers menu for those upgrading). The included xpad has been patched to map the Xbox 360 triggers to buttons, so they work out of the box with Emulation Station, without the need for xboxdrv.

I’ve tried to install xpad but it ended up with could not install package : dkms raspberrypi-kernel-headers