更改国内源,不然下载速度慢的一匹
本文全文使用gedit,可能有点慢,如果熟悉VIM,VI的可以直接使用.
::首先进入超管
sudo su
gedit /etc/apt/sources.list
清空,加入阿里源.
deb http://mirrors.aliyun.com/ubuntu/ bionic main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-proposed main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main multiverse restricted universe
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main multiverse restricted universe
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main multiverse restricted universe
记得保存,
::保存后输入命令
apt-get update
apt-get upgrade -y
apt-get update
apt-get upgrade -y
禁用集成的驱动
::提权,修改到可以修改的权限
sudo chmod 666 /etc/modprobe.d/blacklist.conf
::加入驱动黑名单
sudo gedit /etc/modprobe.d/blacklist.conf
::文本最尾加入
blacklist vga16fb
blacklist nouveau
blacklist rivafb
blacklist rivatv
blacklist nvidiafb
::卸载所有安装的NVIDIA驱动,没有安装过可以省略.
sudo apt-get remove --purge nvidia-*
::安装新驱动
sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
::查看可安装驱动,一般版本越大越新
ubuntu-drivers devices
::查看到之后输入相对应的版本
sudo apt-get install nvidia-driver-440
::安装配对的驱动
sudo apt-get install mesa-common-dev
sudo apt-get install freeglut3-dev
::加入引导
sudo gedit /etc/default/grub
把文件中"…splash"引号内的文本添加一段改成"… splash acpi_osi=linux" (图片高亮)
::再输入以下命令
sudo update-grub2
::保存资料之后
reboot
::重启电脑之后输入命令检查
nvidia-smi
nvidia-settings
cat /proc/driver/nvidia/version
如果无法显示,请再重启一次电脑.