Question: I know that a lot of questions have been posted regarding the installation of OpenCV, but right now I need to install both **OpenCV 2.4** along with **OpenCV 3.0.0**

Since there are a lot of research codes available online and the authors of these say that our code is not compatible with OpenCV 3.0.0, I am wondering how can I install both versions of OpenCV.

Even before the installation instructions, can somebody please tell me how to remove all the existing versions of OpenCV from my PC. I want to do a clean installation of OpenCV, with appropriate setting of all the environment variables.

Thanks in Advance.

Answer: 
The application is installed in `/opt/pt` and the installer has created an desktop file in `/usr/share/applications/pt6.desktop` and an icon. Therefore

```
sudo rm -r /opt/pt
sudo rm /usr/share/applications/pt6.desktop
sudo rm /usr/share/icons/hicolor/48x48/apps/pt6.png

```

---

Additionally, some packages have been installed:

```
lib32z1
lib32ncurses5
lib32bz2-1.0
libgcc1:i386
libstdc++6:i386
libssl-dev:i386
libqtwebkit4:i386
libqt4-scripttools:i386

```

Therefore you could try to remove the packages, but that is not absolutely necessary.

1. `sudo apt-get purge lib32z1`

Check the output and **don't proceed**, if other packages will be removed which are ***not** in the list above.*
2. `sudo apt-get purge lib32ncurses5`

Check the output and **don't** proceed, if other packages to be removed which are ***not** in the list above.*
3. Repeat step 2 for all other packages in the list above.
If you're using latest version, there is an available bash script to uninstall it.

```
/opt/pt/uninstall.sh

```

Here is the content of that file.

```
#!/bin/bash
sudo rm -f /usr/local/bin/packettracer

# check /etc/profile for existance of PT7HOME
PROFILE="/etc/profile" 

# error exit if file does not exist or unreadable
if [ ! -f $PROFILE ]; then
   exit 1
elif [ ! -r $PROFILE ]; then
   exit 2
fi

# read contents
exec 3<&0
exec 0<$PROFILE
while IFS= read -r line
do
  PT7HOME_FOUND=`expr match "$line" 'PT7HOME'`
  if [ $PT7HOME_FOUND -gt 0 ]; then
    continue
  fi

  QT_FOUND=`expr match "$line" 'QT_DEVICE_PIXEL_RATIO'`
  if [ $QT_FOUND -gt 0 ]; then
    continue
  fi

  EXPORT_FOUND=`expr match "$line" 'export PT7HOME'`
  if [ $EXPORT_FOUND -gt 0 ]; then
    continue
  fi

  EXPORT_QT_FOUND=`expr match "$line" 'export QT_DEVICE_PIXEL_RATIO'`
  if [ $EXPORT_QT_FOUND -gt 0 ]; then
    continue
  fi

  CONTENTS="$CONTENTS\n$line"
done
exec 0<&3

sudo echo -e "$CONTENTS" > /etc/profile

exit 0 

```