If you’re going to play games using RetroArch, you’re going to need a proper controller. There are a variety of wired, “classic-style” controllers out there that can offer you a variety of retro experiences, but they all need a driver to work. Fortunately, the Ubuntu repositories have you covered!
First, install the Joystick input driver package:
sudo apt-get install joystick
Next, install the Joystick Configuration package:
sudo apt-get install jstest-gtk
Now you can use
jstest-gtk to configure your settings and calibrate the controller. Everything else is ready to go!