Search CUDA official website, install CUDA:
Options shown above, download.
Download the file into the directory, open a terminal
sudo dpkg -i cuda-repo-ubuntu1604_10.1.105-1_amd64.deb
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda
If the second command error:
Inside copy the URL in the browser open, download.
sudo apt-key 下载的pub文件名
And then complete the remaining instructions.