![无法删除 Nvidia Linux 模块](https://linux22.com/image/953706/%E6%97%A0%E6%B3%95%E5%88%A0%E9%99%A4%20Nvidia%20Linux%20%E6%A8%A1%E5%9D%97.png)
我正在尝试删除特定的 nvidia linux 模块,但是不起作用:
sudo dpkg --remove --force-remove-reinstreq linux-modules-nvidia-525-5.15.0-84-generic
返回:
Reading database...
226734 files and directories already installed.
Removing linux-modules-nvidia-525-5.15.0-84-generic (5.15.0-84.93)...
linux-image-nvidia -5.15.0-84-generic: removing .ko files
/bin/sh: 0: cannot open ./CLEAN: No such file dpkg: error processing package linux-modules-nvidia-525-5.15.0-84- generic (--remove):
installed linux-modules-nvidia-525-5.15.0-84-generic package pre-removal script
subprocess returned error exit status 2
Errors were encountered during execution: linux-modules-nvidia- 525-5.15.0-84-generic
答案1
在我升级 Ubuntu 23.10 到 24.04 后,发生了这种情况。只需从另一个内核模块(即 6.8.X 内核)复制这两个可执行文件即可。
cd /lib/modules/6.8.0-28-generic/kernel/nvidia-535/bits
然后复制那些缺失的可执行文件
sudo cp BUILD /lib/modules/6.5.0-28-generic/kernel/nvidia-535/bits
sudo cp CLEAN /lib/modules/6.5.0-28-generic/kernel/nvidia-535/bits
然后继续
apt --fix-broken install