无法清除 nvidia-304 - DKMS 问题返回删除错误

无法清除 nvidia-304 - DKMS 问题返回删除错误
sudo  apt-get purge nvidia-304  
Reading package lists... Done  
Building dependency tree         
Reading state information... Done  
The following packages were automatically installed and are no longer required:
  kde-l10n-engb screen-resolution-extra  
Use 'apt-get autoremove' to remove them.  
The following packages will be REMOVED:  
  nvidia-304*  
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.  
1 not fully installed or removed.    
After this operation, 172 MB disk space will be freed.  
Do you want to continue? [Y/n] y  
(Reading database ... 274272 files and directories currently installed.)  
Removing nvidia-304 (304.125-0ubuntu1~xedgers14.10.1) ...  
Removing all DKMS Modules  
Error! There are no instances of module: nvidia-304  
304.125 located in the DKMS tree.  
Done.  
  File "/usr/bin/quirks-handler", line 54  
    pass  
       ^  
IndentationError: expected an indented block  
dpkg: error processing package nvidia-304 (--purge):  
 subprocess installed pre-removal script returned error exit status 1  
Processing triggers for libc-bin (2.19-10ubuntu2.2) ...  
Errors were encountered while processing:  
 nvidia-304  
E: Sub-process /usr/bin/dpkg returned an error code (1)  

我尝试了所有方法来解决此错误,但我无能为力。有人能帮忙吗?这是在安装 nvidia 驱动程序后发生的,现在它又开始出现问题了。我读了很多帖子,都遇到了同样的问题,并且都解决了,但他们的方法不适用于我的 ubuntu

答案1

您是否尝试过这个,并从终端输入:

  sudo apt-get install --reinstall dkms
  sudo apt-get -f install
  sudo apt-get install aptitude
  sudo apt-get update
  sudo apt-get upgrade
  sudo apt-get dist-upgrade
  sudo aptitude

这样也许能很好地发挥作用。

答案2

nvidia-304尝试先重新安装( sudo apt-get install --reinstall nvidia-304),然后清除它。我认为这是由于缺少 DKMS 模块而无法完全删除,从而导致错误。

答案3

我尝试了 Thomas W 的建议,但是没有用,因为 apt-get 一直因有关模块的相同错误而失败。

我在另一个网站上找到了这个问题:http://iswwwup.com/t/eb23b280a9f5/apt-cannot-purge-nvidia-304-dkms-issue-returns-a-removal-error.html这帮助了我。

我运行了sudo apt-get -f install,然后运行了sudo apt-get remove --purge nvidia-*建议的,但我必须运行两次。第一次删除了 nvidia-304 的所有依赖项,第二次删除了模块本身。然后我可以继续执行我正在执行的 dist-upgrade。

相关内容