安装 nvidia-driver-440 Broke Apt?

安装 nvidia-driver-440 Broke Apt?

我尝试安装nvidia-driver-440来升级我的图形驱动程序。

一切起初都很顺利,apt install nvidia-driver-440因为 root 用户照常进行操作,但是后来某个地方出现故障并返回错误。

我通常使用 修复此类问题apt fix-broken install,但这次没有奏效,并导致了另一个错误:

    root@LesserArk:/home/sarah# apt --fix-broken 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:
  lib32gcc-s1 lib32gcc1 libc6-i386
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libnvidia-gl-440 libnvidia-gl-440:i386
The following NEW packages will be installed:
  libnvidia-gl-440 libnvidia-gl-440:i386
0 upgraded, 2 newly installed, 0 to remove and 6 not upgraded.
3 not fully installed or removed.
Need to get 0 B/79.6 MB of archives.
After this operation, 281 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 243074 files and directories currently installed.)
Preparing to unpack .../libnvidia-gl-440_440.82+really.440.64-0ubuntu6_i386.deb ...
diversion of /usr/lib/i386-linux-gnu/libGL.so.1 to /usr/lib/i386-linux-gnu/libGL.so.1.distrib by nvidia-340
dpkg-divert: error: mismatch on package
  when removing 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 by libnvidia-gl-440'
  found 'diversion of /usr/lib/i386-linux-gnu/libGL.so.1 to /usr/lib/i386-linux-gnu/libGL.so.1.distrib by nvidia-340'
dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-440_440.82+really.440.64-0ubuntu6_i386.deb (--unpack):
 new libnvidia-gl-440:i386 package pre-installation script subprocess returned error exit status 2
Preparing to unpack .../libnvidia-gl-440_440.82+really.440.64-0ubuntu6_amd64.deb ...
diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340
dpkg-divert: error: mismatch on package
  when removing 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 by libnvidia-gl-440'
  found 'diversion of /usr/lib/x86_64-linux-gnu/libGL.so.1 to /usr/lib/x86_64-linux-gnu/libGL.so.1.distrib by nvidia-340'
dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-440_440.82+really.440.64-0ubuntu6_amd64.deb (--unpack):
 new libnvidia-gl-440:amd64 package pre-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/libnvidia-gl-440_440.82+really.440.64-0ubuntu6_i386.deb
 /var/cache/apt/archives/libnvidia-gl-440_440.82+really.440.64-0ubuntu6_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Dist-upgrade 同样让我回去修复损坏的安装。

root@LesserArk:/home/sarah# apt dist-upgrade 
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:
 libnvidia-ifr1-440 : Depends: libnvidia-gl-440 but it is not installed
 libnvidia-ifr1-440:i386 : Depends: libnvidia-gl-440:i386 but it is not installed
 nvidia-driver-440 : Depends: libnvidia-gl-440 (= 440.82+really.440.64-0ubuntu6) but it is not installed
                     Recommends: libnvidia-gl-440:i386 (= 440.82+really.440.64-0ubuntu6)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

不知道接下来该怎么做。如何恢复我的软件包系统并安装 nvidia 驱动程序?

硬件:

sarah@LesserArk:~$ inxi -Fx
System:    Host: LesserArk Kernel: 5.4.0-31-generic x86_64 bits: 64 compiler: gcc v: 9.3.0 Desktop: KDE Plasma 5.18.5 
           Distro: Ubuntu 20.04 LTS (Focal Fossa) 
Machine:   Type: Laptop System: Hewlett-Packard product: HP ENVY 17 Notebook PC v: 097E110000405E00000620100 
           serial: <superuser/root required> 
           Mobo: Hewlett-Packard model: 1968 v: KBC Version 93.52 serial: <superuser/root required> UEFI: Insyde v: F.70 
           date: 10/20/2017 
Battery:   ID-1: BAT0 charge: 41.2 Wh condition: 41.2/41.2 Wh (100%) model: Hewlett-Packard Primary status: Full 
CPU:       Topology: Quad Core model: Intel Core i7-4702MQ bits: 64 type: MT MCP arch: Haswell rev: 3 L2 cache: 6144 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 35121 
           Speed: 2897 MHz min/max: 800/3200 MHz Core speeds (MHz): 1: 2897 2: 2895 3: 2894 4: 2907 5: 2912 6: 2936 7: 2894 
           8: 2895 
Graphics:  Device-1: Intel 4th Gen Core Processor Integrated Graphics vendor: Hewlett-Packard driver: i915 v: kernel 
           bus ID: 00:02.0 
           Device-2: NVIDIA GK107M [GeForce GT 750M] vendor: Hewlett-Packard driver: nvidia v: 390.132 bus ID: 01:00.0 
           Display: x11 server: X.Org 1.20.8 driver: modesetting,nvidia unloaded: fbdev,nouveau,vesa 
           resolution: 1920x1080~60Hz, 1920x1080~75Hz 
           OpenGL: renderer: N/A v: N/A direct render: N/A 
Audio:     Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor HD Audio vendor: Hewlett-Packard driver: snd_hda_intel 
           v: kernel bus ID: 00:03.0 
           Device-2: Intel 8 Series/C220 Series High Definition Audio vendor: Hewlett-Packard driver: snd_hda_intel v: kernel 
           bus ID: 00:1b.0 
           Sound Server: ALSA v: k5.4.0-31-generic 
Network:   Device-1: Intel Wireless 7260 driver: iwlwifi v: kernel port: 5000 bus ID: 07:00.0 
           IF: wlp7s0 state: up mac: e4:70:b8:f8:99:b8 
           Device-2: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet vendor: Hewlett-Packard driver: r8169 v: kernel 
           port: 3000 bus ID: 0f:00.0 
           IF: eno1 state: up speed: 1000 Mbps duplex: full mac: a0:1d:48:fa:67:c0 
           IF-ID-1: tun0 state: unknown speed: 10 Mbps duplex: full mac: N/A 
Drives:    Local Storage: total: 3.21 TiB used: 1.18 TiB (36.8%) 
           ID-1: /dev/sda vendor: Toshiba model: MQ01ABD100 size: 931.51 GiB 
           ID-2: /dev/sdb vendor: LITE-ON IT model: LMS-24L6M-HP size: 22.37 GiB 
           ID-3: /dev/sdc vendor: Seagate model: ST2000LM015-2E8174 size: 1.82 TiB 
           ID-4: /dev/sdd vendor: Samsung model: SSD 860 EVO 500GB size: 465.76 GiB 
           ID-5: /dev/sde type: USB vendor: SanDisk model: Gaming Xbox 360 size: 7.48 GiB 
           ID-6: /dev/sdf type: USB vendor: SanDisk model: U3 Cruzer Micro size: 1.91 GiB 
RAID:      Hardware-1: Intel 82801 Mobile SATA Controller [RAID mode] driver: ahci v: 3.0 bus ID: 00:1f.2 
Partition: ID-1: / size: 398.61 GiB used: 208.28 GiB (52.3%) fs: btrfs dev: /dev/sdd2 
           ID-2: /home size: 398.61 GiB used: 208.28 GiB (52.3%) fs: btrfs dev: /dev/sdd2 
           ID-3: swap-1 size: 14.90 GiB used: 221.5 MiB (1.5%) fs: swap dev: /dev/sdd3 
Sensors:   System Temperatures: cpu: 63.0 C mobo: 61.0 C gpu: nvidia temp: 57 C 
           Fan Speeds (RPM): N/A 
Info:      Processes: 468 Uptime: 10h 44m Memory: 15.57 GiB used: 10.78 GiB (69.2%) Init: systemd runlevel: 5 Compilers: 
           gcc: 9.3.0 Shell: bash v: 5.0.16 inxi: 3.0.38

答案1

如果没有,请尝试“安装第三方软件”。它解决了我的问题。这是安装过程的一部分。最好的方法是进行全新安装,以确保摆脱损坏的安装驱动程序。就我而言,这会自动安装所需的专有驱动程序。

我尝试了所有方法和很多命令,但没有什么效果。

在此处输入图片描述

在 Ubuntu 20.04LTS 官方文档中也将其提及为“已知问题”:

在此处输入图片描述

我还建议在全新安装之前禁用“安全启动”并启用“传统启动”。希望这会有所帮助。

答案2

这可能会解决您的问题:打开终端 CTR + ALT + T,然后输入以下命令:

sudo apt update && sudo apt upgrade

然后:

sudo apt autoremove

然后:

sudo apt install -f

然后:

sudo apt update --fix-missing

然后:

sudo dpkg --configure -a

然后:

sudo dpkg -l | grep ^..r

然后:sudo dpkg --remove --force-remove --reinstreq 然后:

sudo apt clean
sudo apt update

相关内容