Update your package list and install the package
# apt-get update-y
# apt-get install rpi-usb-gadget
Enable the feature:
# rpi-usb-gadget on

Update your package list and install the package