E:无法纠正问题,您持有损坏的软件包。安装 nvidia-driver 535

E:无法纠正问题,您持有损坏的软件包。安装 nvidia-driver 535
sudo apt install nvidia-driver-535
The following packages have unmet dependencies:
 nvidia-driver-535 : Depends: libnvidia-compute-535 (= 535.104.12-0ubuntu1) but 535.113.01-0ubuntu0.22.04.3 is to be installed
                     Depends: libnvidia-extra-535 (= 535.104.12-0ubuntu1) but 535.113.01-0ubuntu0.22.04.3 is to be installed
                     Depends: libnvidia-decode-535 (= 535.104.12-0ubuntu1) but 535.113.01-0ubuntu0.22.04.3 is to be installed
                     Depends: libnvidia-encode-535 (= 535.104.12-0ubuntu1) but 535.113.01-0ubuntu0.22.04.3 is to be installed
                     Depends: xserver-xorg-video-nvidia-535 (= 535.104.12-0ubuntu1) but 535.113.01-0ubuntu0.22.04.3 is to be installed
                     Depends: libnvidia-cfg1-535 (= 535.104.12-0ubuntu1) but 535.113.01-0ubuntu0.22.04.3 is to be installed
                     Depends: libnvidia-fbc1-535 (= 535.104.12-0ubuntu1) but 535.113.01-0ubuntu0.22.04.3 is to be installed
                     Recommends: nvidia-settings but it is not going to be installed
                     Recommends: nvidia-prime (>= 0.8) but it is not going to be installed
                     Recommends: libnvidia-compute-535:i386 (= 535.104.12-0ubuntu1)
                     Recommends: libnvidia-decode-535:i386 (= 535.104.12-0ubuntu1)
                     Recommends: libnvidia-encode-535:i386 (= 535.104.12-0ubuntu1)
                     Recommends: libnvidia-fbc1-535:i386 (= 535.104.12-0ubuntu1)
E: Unable to correct problems, you have held broken packages.```

答案1

首先必须清除现有的 nvidia 驱动程序。假设你有nvidia-driver-470

  1. 运行sudo apt purge nvidia-driver-470。您还需要清除与该驱动程序相关的所有 nvidia 内容470
  2. dkms使用安装apt
  3. 跑步sudo apt update
  4. 重启电脑
  5. 跑步sudo apt install nvidia-driver-535

如果您还有任何问题请继续询问我!

答案2

更新之前,您需要从系统中清除旧的 nvidia 文件,这需要重新启动。然后,强制安装所需的软件包。最后,按预期安装驱动程序。

使用以下方法sudo运行不是以 root 身份!

1. 清除 nvidia-*

sudo apt purge nvidia-*
sudo apt update
sudo reboot

2.强制安装依赖项并修复

sudo apt install -y libnvidia-fbc1-535 libnvidia-cfg1-535 xserver-xorg-video-nvidia-535 libnvidia-encode-535 libnvidia-decode-535 libnvidia-extra-535 libnvidia-compute-535
sudo apt --fix-broken install

3.安装驱动程序

sudo apt install -y nvidia-driver-535

最后一次重新启动,你就应该成功了。

答案3

改进上面的@noone 回答,这对我有用:

  1. 清除 nvidia-*

    sudo apt purge nvidia-*
    sudo apt update
    sudo reboot
    
  2. 安装所需的确切版本:

    sudo apt libnvidia-compute-535=535.104.12-0ubuntu1
    
  3. 强制安装依赖项并修复

    sudo apt install -y libnvidia-fbc1-535 libnvidia-cfg1-535 xserver-xorg-video-nvidia-535 libnvidia-encode-535 libnvidia-decode-535 libnvidia-extra-535 libnvidia-compute-535
    sudo apt --fix-broken install
    
  4. 安装驱动程序

    sudo apt install -y nvidia-driver-535
    

编辑:如果由于依赖关系而导致错误仍然存​​在,请继续安装每个包的特定版本,直到成功。 gdebi 将逐一列出它们,始终打印第一个未满足的依赖项。 apt 将打印所有内容,因此您必须小心安装所有依赖项(几乎 10 个)。

相关内容