I found the solution. I installed the driver for the usb wifi adapter successfully using the following:
sudo apt-get update
sudo apt-get install linux-headers-$(uname -r)
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install git
git clone https://github.com/lwfinger/rtl8188eu
cd rtl8188eu
make all
sudo make install
sudo modprobe 8188eu.ko
and then I used the following command:
sudo lshw -C network
to get the internal wifi driver file name and then add it to blacklist
sudo -H gedit /etc/modprobe.d/blacklist
and add the following line to the end of the file:
blacklist xxxxx
where xxxx
is the internal wifi driver file name.
Restart and Ubuntu should now work with the usb adapter.
Note: if your internal wifi is fine then you don't need to blacklist it, i only did that because it was tuened off by hardware switch and doesn't want to turn on again and it turns off the usb wifi as well so i had to blacklist it.