Ubuntu 18.04 频繁死机,且 sudo ubuntu-drivers 自动安装不起作用

Ubuntu 18.04 频繁死机,且 sudo ubuntu-drivers 自动安装不起作用

我注意到我的电脑开始更频繁地冻结,这让我很担心。我有一个 Ubuntu 18.04,它完全冻结,所以我不得不重新启动它。

我运行了“ubuntu-drivers devices”,因为我在网上看到这可能是一个图形问题。

ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0 ==
modalias : pci:v000010DEd00000FFDsv0000103Csd00000967bc03sc00i00
vendor   : NVIDIA Corporation
model    : GK107 [NVS 510]
driver   : nvidia-340 - distro non-free
driver   : nvidia-driver-390 - distro non-free recommended
driver   : xserver-xorg-video-nouveau - distro free builtin

由于建议,我尝试安装 nvidia-driver-390,但没有起作用:

sudo ubuntu-drivers autoinstall
Reading package lists... Done
Building dependency tree       
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:
 nvidia-driver-390 : Depends: xserver-xorg-video-nvidia-390 (= 390.48-0ubuntu3) but it is not going to be installed
                     Recommends: libnvidia-compute-390:i386 (= 390.48-0ubuntu3)
                     Recommends: libnvidia-decode-390:i386 (= 390.48-0ubuntu3)
                     Recommends: libnvidia-encode-390:i386 (= 390.48-0ubuntu3)
                     Recommends: libnvidia-ifr1-390:i386 (= 390.48-0ubuntu3)
                     Recommends: libnvidia-fbc1-390:i386 (= 390.48-0ubuntu3)
                     Recommends: libnvidia-gl-390:i386 (= 390.48-0ubuntu3)
E: Unable to correct problems, you have held broken packages.

为了修复这个问题我运行了:

sudo dpkg --configure -a && sudo apt update --fix-missing && sudo apt install -f && sudo apt full-upgrade

但当我尝试安装 nivida-driver-390 时仍然收到相同的错误消息

下一步我可以尝试什么?

编辑:评论中要求的内容:

apt-cache policy nvidia-driver-390
nvidia-driver-390:
  Installed: (none)
  Candidate: 390.48-0ubuntu3
  Version table:
     390.48-0ubuntu3 500
        500 http://archive.ubuntu.com/ubuntu bionic/restricted amd64 Packages
grep "bionic-updates\|bionic-security" /etc/apt/sources.list
(returns nothing)

运行答案中 mchid 建议的行后:

ubuntu-drivers devices
== /sys/devices/pci0000:00/0000:00:03.0/0000:05:00.0 ==
modalias : pci:v000010DEd00000FFDsv0000103Csd00000967bc03sc00i00
vendor   : NVIDIA Corporation
model    : GK107 [NVS 510]
driver   : nvidia-driver-418-server - distro non-free
driver   : nvidia-340 - distro non-free
driver   : nvidia-driver-440-server - distro non-free
driver   : nvidia-driver-450 - distro non-free
driver   : nvidia-driver-390 - distro non-free
driver   : nvidia-driver-450-server - distro non-free recommended
driver   : nvidia-driver-435 - distro non-free
driver   : xserver-xorg-video-nouveau - distro free builtin

答案1

/etc/apt/sources.list您的文件中似乎缺少以下几行:

deb http://security.ubuntu.com/ubuntu bionic-security main restricted
deb http://archive.ubuntu.com/ubuntu bionic-updates main restricted

您需要编辑/etc/apt/sources.list文件,但首先运行以下命令来备份文件:

sudo cp /etc/apt/sources.list /etc/apt/sourceslist

现在,运行以下命令,它将编辑您的文件并添加缺失的行:

printf '\ndeb http://security.ubuntu.com/ubuntu bionic-security main restricted\ndeb http://archive.ubuntu.com/ubuntu bionic-updates main restricted\n' | sudo tee -a /etc/apt/sources.list

最后,运行以下命令来更新您的软件包列表并安装 nvidia 驱动程序:

sudo apt update
sudo ubuntu-drivers autoinstall

此外,您可能应该运行完整升级,因为您很可能缺少其他更新:

sudo apt full-upgrade

请发布任何错误。

答案2

尝试安装xserver-xorg-video-nvidia-390(使用 Apt)。如果安装了其他版本,请卸载它,然后重试sudo ubuntu-drivers autoinstall

相关内容