removing cuda 10.0 and installing cuda 9.0

I have cuda 10.0 installed on my Ubuntu 18.04 sys and I want to revert it to cuda 9.0.
what are the lines I need to run in terminal to do so? It appears that 9.0 supports only Ubuntu 16.04.
please add the commands if you can, since there are lots of patches under 9.0 version published here.
Please help.