apt – Uninstall OpenCV 4.2.0 and its Libraries

I’m quite new to Ubuntu and I just installed opencv and some additional libraries using

sudo apt update
sudo apt install libopencv-dev python3-opencv sudo apt install libjpeg-dev libpng-dev libtiff-dev

I’m now trying to downgrade from opencv 4.2.0 to opencv 4.1.1.26.

How can I do this?