Uninstall a nvidia driver completely

本文提供了一套步骤来彻底清除NVIDIA显卡驱动,并使用开源驱动nouveau替代,包括卸载相关软件包、强制加载新模块、删除配置文件等操作。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Commands can be executed to terminal. You can open a terminal with Ctrl + Alt+T keys combo.

If you remove --purge the nvidia driver you will be OK. No need to blacklist something, but sometimes maybe a force-load of the nouveau module needed.

First uninstall completely the driver.

Search what packages from nvidia you have installed.

dpkg -l | grep -i nvidia

except the package nvidia-common all other packages should be purged.


If you want to be sure that you will purge everything related to nvidia you can give this command

sudo apt-get remove --purge nvidia-*

the asterisk in the end means (Purge everything that begins with the name nvidia-)

BUT

above command will also remove the nvidia-common package and the nvidia-common package has as a dependency the ubuntu-desktop package.

So after above command you should also give the installation command for ubuntu-desktop package

sudo apt-get install ubuntu-desktop

Also sometimes the nouveau driver get blacklisted from nvidia driver. With purge command it should UN-blacklisted. If you want to be sure that nouveau will be load in boot, you can force-load it by add it to /etc/modules

echo 'nouveau' | sudo tee -a /etc/modules

Last , search for the xorg.conf file and remove it as well

sudo rm /etc/X11/xorg.conf

In summary

sudo apt-get remove --purge nvidia-*
sudo apt-get install ubuntu-desktop
sudo rm /etc/X11/xorg.conf
echo 'nouveau' | sudo tee -a /etc/modules

Although all above commands not needed, this is my way to completely purge the nvidia driver and use the open source nounveau.

More Info.

### 如何安装 Nvidia Driver Local Repo Nvidia 提供了一种通过本地存储库来管理驱动程序的方法,这种方式可以更方便地管理和更新 GPU 驱动。以下是关于 `nvidia-driver-local-repo` 的安装方法及相关说明。 #### 使用 APT 进行安装 可以通过以下命令将 Nvidia 的本地仓库添加到系统的软件源列表中: ```bash sudo dpkg -i nvidia-driver-local-repo-<os>_<version>-<arch>.deb ``` 其中 `<os>` 是操作系统名称(如 ubuntu),`<version>` 是驱动版本号,而 `<arch>` 表示架构(通常是 amd64)。此 `.deb` 文件可以从 Nvidia 官方网站下载[^1]。 完成上述操作后,需运行以下命令刷新包索引并激活新加入的仓库: ```bash sudo apt update ``` 接着可以直接安装所需的驱动版本,例如: ```bash sudo apt install nvidia-driver-525 ``` 这一步骤与标准 Ubuntu 软件中心中的方式一致[^2]。 #### 手动卸载旧版驱动 如果系统上已经存在其他版本的 Nvidia 驱动,则可能需要先将其移除再继续新的安装流程。执行如下指令可实现这一目标: ```bash sh NVIDIA-Linux-x86_64-*.run --uninstall ``` 这里假设当前目录下有对应的 .run 文件可用作卸载工具[^3]。 对于某些特定场景下的高级配置需求,比如涉及 Mellanox OFED 或者 CUDA 工具链集成时,还需要额外考虑兼容性和依赖关系等问题[^4]。 #### 注意事项 在整个过程中要确保网络连接正常以及所选驱动版本适合自己的硬件设备型号;另外,在任何重要更改之前建议备份数据以防万一出现问题影响正常使用体验。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值