问题
我在 ubuntu 22.04.2(不是 22.04.1)上尝试安装 Nvidia 驱动程序时收到以下错误。如果有人知道如何处理这个问题,请告诉我。
$ sudo ubuntu-drivers install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
linux-modules-nvidia-525-open-generic-hwe-22.04 : Depends: linux-modules-nvidia-525-open-5.19.0-35-generic (= 5.19.0-35.36~22.04.1) but it is not going to be installed
Depends: nvidia-kernel-common-525 (>= 525.85.05) but 525.78.01-0ubuntu0.22.04.1 is to be installed
E: Unable to correct problems, you have held broken packages.
尝试过
# edited the following file
/usr/lib/python3/dist-packages/UbuntuDrivers/detect.py
- version = int(package_name.split('-')[-1])
+ version = int(package_name.split('-')[2])
答案1
通过以下命令解决。
sudo ubuntu-drivers install nvidia:515
看来525和ubuntu22.04.2的内核版本不匹配。