sudo apt-get -t=2.3.1 install libopencv
Is there a way to figure put which command I have to type to get 2.3.1 running?
The default on Ubuntu 13.04 is 2.4
Download the DEB installer file for version 2.3 and install it manually. Or through Ubuntu software center even (by doubleclicking the DEB).
2.3 can be found here: http://packages.ubuntu.com/source/precise/opencv (debian) or from the official website: http://sourceforge.net/projects/opencvlibrary/files/opencv-unix/ (sources).