
There is nothing to install anymore on recent versions of Ubuntu, as Dualshock 3 (and 4 I believe) is natively supported by the Kernel, in both USB and Bluetooth. You can test the functionality of your controller through Jstest-gtk (install: sudo apt-get install jstest-gtk)
If you press the Playstation button, the computer will receive its input and simulate it as an Xbox 360 controller, which should work the same as the playstation controller. start xboxdrv with sudo xboxdrv -detach-kernel-driver.
install xboxdrv from the Ubuntu Software Center or with sudo apt-get install xboxdrv. If it does not work automatically, this link might answer your question. I use another similar PnP controller, and it works without difficulty. It might be that the controller already works if you do this (You can test this with jstest-gtk as listed below). I don't know how to connect the controller via bluetooth to your computer (if you even have a bluetooth receiver), so this answer focusses on usb connection.
This is supplied with a PS3 device (it is the primary way to charge the controller).
You are able to connect the controller to the pc via usb cable.