nvidia驅動程序390損壞的依賴性 - 阻止卸載或新安裝

分享于 

6分钟阅读

ubuntu

  简体

问题:

尝试升级到440时,我不小心破坏了nvidia驱动程序390。我真的不想重新安装ubuntub/windows10.

nvcc --version返回:Cuda 9.2

nvidia-smi返回:command not found...

sudo apt-get update或sudo apt -f install上,我得到以下错误。


$ sudo apt -f install


Reading package lists... Done


Building dependency tree 


Reading state information... Done


Correcting dependencies... Done


The following packages were automatically installed and are no longer required:


 libnvidia-cfg1-390 libnvidia-common-390


 libnvidia-fbc1-390 libnvidia-fbc1-390:i386


 libnvidia-gl-390 libnvidia-gl-390:i386


 libnvidia-ifr1-390 libnvidia-ifr1-390:i386


 libwayland-client0:i386 libwayland-server0:i386


 nvidia-dkms-390 nvidia-kernel-common-390


 nvidia-kernel-source-390


Use 'sudo apt autoremove' to remove them.


The following additional packages will be installed:


 nvidia-390


The following NEW packages will be installed:


 nvidia-390


0 upgraded, 1 newly installed, 0 to remove and 22 not upgraded.


2 not fully installed or removed.


Need to get 0 B/74.1 MB of archives.


After this operation, 308 MB of additional disk space will be used.


Do you want to continue? [Y/n] Y


(Reading database ... 260157 files and directories currently installed.)


Preparing to unpack .../nvidia-390_390.116-0ubuntu1_amd64.deb ...


Unpacking nvidia-390 (390.116-0ubuntu1) ...


dpkg: error processing archive /var/cache/apt/archives/nvidia-390_390.116-0ubuntu1_amd64.deb (--unpack):


 trying to overwrite '/sbin/create-uvm-dev-node', which is also in package nvidia-kernel-common-390 390.138-0ubuntu0.18.04.1


dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)


Errors were encountered while processing:


 /var/cache/apt/archives/nvidia-390_390.116-0ubuntu1_amd64.deb


E: Sub-process /usr/bin/dpkg returned an error code (1)



所以我...


$ sudo apt autoremove


Reading package lists... Done


Building dependency tree 


Reading state information... Done


You might want to run 'apt --fix-broken install' to correct these.


The following packages have unmet dependencies:


 libcuda1-390 : Depends: nvidia-390 (>= 390.116) but it is not installed


 nvidia-opencl-icd-390 : Depends: nvidia-390 (>= 390.116) but it is not installed


E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).




答案1:

最佳解决方案:


sudo apt-get update --fix-missing



sudo dpkg --configure -a



sudo apt-get install -f



sudo apt-get clean



sudo apt-get autoremove



解锁dpkg (/var/lib/dpkg/lock)


sudo fuser -vki /var/lib/dpkg/lock.



sudo dpkg --configure -a



可以使用以下命令删除锁文件:


sudo rm /var/lib/apt/lists/lock



你可能还需要删除缓存目录中的锁文件


sudo rm /var/cache/apt/archives/lock



现在你可以安装Nvidia-390:

首先,检测nvidia显卡的型号和推荐的驱动程序,为此执行:


ubuntu-drivers devices



== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==


modalias : pci:v000010DEd00001180sv00001458sd0000353Cbc03sc00i00


vendor : NVIDIA Corporation


model : GP106 [GeForce GTX 1060 6GB]


driver : nvidia-304 - distro non-free


driver : nvidia-340 - distro non-free


driver : nvidia-390 - distro non-free recommended


driver : xserver-xorg-video-nouveau - distro free builtin



如果你同意该建议,请再次使用ubuntu驱动程序命令来安装所有推荐的驱动程序:


sudo ubuntu-drivers autoinstall



sudo apt install nvidia-390



sudo apt update



sudo apt upgrade



安装结束后,重新启动系统,然后完成。

使用PPA存储库自动安装Nvidia Beta驱动程序

要继续,请先添加ppa :图形驱动程序/ppa系统中的存储库:


sudo add-apt-repository ppa:graphics-drivers/ppa



sudo apt update



接下来,确定你的显卡型号和推荐的驱动程序:


ubuntu-drivers devices



== /sys/devices/pci0000:00/0000:00:01.0/0000:01:00.0 ==


modalias : pci:v000010DEd00001C03sv00001043sd000085ABbc03sc00i00


vendor : NVIDIA Corporation


model : GP106 [GeForce GTX 1060 6GB]


driver : nvidia-driver-390 - third-party free


driver : nvidia-driver-410 - third-party free recommended


driver : nvidia-driver-396 - third-party free


driver : xserver-xorg-video-nouveau - distro free builtin



现在安装所需的驱动程序是nvidia-390

 sudo ubuntu-drivers autoinstall 

sudo apt install nvidia-390



sudo apt update



sudo apt upgrade



完成后,重新启动系统。



bro  PRE  Drive  DEP  依赖  卸载  
相关文章