dpkg: error processing archive /var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb (--unpack) [duplicate]

The error that you are getting is:

dpkg: error processing archive /var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb (--unpack):
 trying to overwrite '/usr/local/cuda-9.1/lib64', which is also in package cuda-cudart-9-1 9.1.85-1

The "trying to overwrite" error implies that you have conflicting packages in your system.You can try overwriting the package (can be a bit risky)

sudo dpkg -i --force-overwrite /var/cache/apt/archives/cuda-cublas-9-1_9.1.85.3-1_amd64.deb You need to remove that package

If that doesn't fix it, you can remove the package and re-install it

sudo dpkg -P cuda-cublas