apt 和 Nvidia 显卡驱动程序的问题

apt 和 Nvidia 显卡驱动程序的问题

我有一台东芝 Satellite P-50-A-12z i7-4700,配有 Nvidia GK107m GeForce GT 745M 显卡。我从软件中心安装了 Nvidia 驱动程序,但我得到了几个选项,并将它们全部安装。

nvidia-340 nvidia-驱动程序-390 nvidia-驱动程序-440

据我了解,与我对应的是 440,但我已经全部安装了,并且无法删除它们,也无法安装任何一个。

我尝试用这个命令安装:

sudo apt-get install nvidia-driver-440

结果:

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 going to be installed
libnvidia-ifr1-440:i386 : Depends: libnvidia-gl-440 (= 440.59-0ubuntu0.18.04.1) but it is not going to be installed
                     Recommends: libnvidia-gl-440:i386(=440.59-0ubuntu0.18.04.1)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).

我试过:

$ apt --fix-broken install 

我也尝试用这个来解决这个问题文章,但似乎没有任何效果。我不知道该怎么办了。apt 无法安装任何东西。

答案1

好的,我自己决定,我阅读了此文档:

https://forums.developer.nvidia.com/t/cannot-purge-and-install-nvidia-driver/59422/4

我使用这个命令来删除所有依赖关系损坏的程序(抱歉我的英文不好)

sudo dpkg --force-all -P [name of package with unmet dependency]

然后我使用:

$sudo apt autoclean && apt clean

sudo apt update && apt upgrade

终端抛出这个:

$ sudo apt-get upgrade
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias       
Leyendo la información de estado... Hecho
Tal vez quiera ejecutar «apt --fix-broken install» para corregirlo.
Los siguientes paquetes tienen dependencias incumplidas:
 **libnvidia-ifr1-440** : Depende: libnvidia-gl-440 pero no está instalado
E: Dependencias incumplidas. Intente «apt --fix-broken install» sin paquetes (o especifique una solución).

我用这个:

$sudo dpkg --force-all -P libnvidia-ifr1-440

sudo apt update && apt upgrade

Leyendo lista de paquetes... Hecho
Creando árbol de dependencias       
Leyendo la información de estado... Hecho
Calculando la actualización... Hecho
Los paquetes indicados a continuación se instalaron de forma automática y ya no son necesarios.
  gedit-common gedit-plugins-common gir1.2-ggit-1.0 gir1.2-gtksource-3.0 gir1.2-peas-1.0 lib32gcc1 libatomic1:i386
  libbsd0:i386 libc6-i386 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386
  libedit2:i386 libelf1:i386 libexpat1:i386 libffi6:i386 libgl1:i386 libgl1-mesa-dri:i386 libglapi-mesa:i386
  libglvnd0:i386 libglx-mesa0:i386 libglx0:i386 libido3-0.1-0 libllvm8 libllvm9:i386 libnvidia-cfg1-440
  libnvidia-common-440 libnvidia-compute-440 libnvidia-compute-440:i386 libnvidia-decode-440 libnvidia-decode-440:i386
  libnvidia-encode-440 libnvidia-encode-440:i386 libnvidia-fbc1-440 libnvidia-fbc1-440:i386 libpciaccess0:i386
  libsensors4:i386 libstdc++6:i386 libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386
  libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386 libxcb1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386
  libxfixes3:i386 libxnvctrl0 libxshmfence1:i386 libxxf86vm1:i386 linux-headers-5.0.0-37
  linux-headers-5.0.0-37-generic linux-headers-5.3.0-51 linux-headers-5.3.0-51-generic linux-image-5.0.0-37-generic
  linux-image-5.3.0-51-generic linux-modules-5.0.0-37-generic linux-modules-5.3.0-51-generic
  linux-modules-extra-5.0.0-37-generic linux-modules-extra-5.3.0-51-generic nvidia-dkms-440 nvidia-kernel-common-440
  nvidia-kernel-source-440 nvidia-prime nvidia-settings ocl-icd-libopencl1 pkg-config screen-resolution-extra
  xserver-xorg-video-nvidia-440
Utilice **«sudo apt autoremove»** para eliminarlos.
0 actualizados, 0 nuevos se instalarán, 0 para eliminar y 0 no actualizados.

然后我用这个:

$sudo apt autoremove

Leyendo lista de paquetes... Hecho
Creando árbol de dependencias       
Leyendo la información de estado... Hecho
Los siguientes paquetes se ELIMINARÁN:
  gedit-common gedit-plugins-common gir1.2-ggit-1.0 gir1.2-gtksource-3.0 gir1.2-peas-1.0 lib32gcc1 libatomic1:i386
  libbsd0:i386 libc6-i386 libdrm-amdgpu1:i386 libdrm-intel1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386
  libedit2:i386 libelf1:i386 libexpat1:i386 libffi6:i386 libgl1:i386 libgl1-mesa-dri:i386 libglapi-mesa:i386
  libglvnd0:i386 libglx-mesa0:i386 libglx0:i386 libido3-0.1-0 libllvm8 libllvm9:i386 libnvidia-cfg1-440
  libnvidia-common-440 libnvidia-compute-440 libnvidia-compute-440:i386 libnvidia-decode-440 libnvidia-decode-440:i386
  libnvidia-encode-440 libnvidia-encode-440:i386 libnvidia-fbc1-440 libnvidia-fbc1-440:i386 libpciaccess0:i386
  libsensors4:i386 libstdc++6:i386 libx11-6:i386 libx11-xcb1:i386 libxau6:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386
  libxcb-glx0:i386 libxcb-present0:i386 libxcb-sync1:i386 libxcb1:i386 libxdamage1:i386 libxdmcp6:i386 libxext6:i386
  libxfixes3:i386 libxnvctrl0 libxshmfence1:i386 libxxf86vm1:i386 linux-headers-5.0.0-37
  linux-headers-5.0.0-37-generic linux-headers-5.3.0-51 linux-headers-5.3.0-51-generic linux-image-5.0.0-37-generic
  linux-image-5.3.0-51-generic linux-modules-5.0.0-37-generic linux-modules-5.3.0-51-generic
  linux-modules-extra-5.0.0-37-generic linux-modules-extra-5.3.0-51-generic nvidia-dkms-440 nvidia-kernel-common-440
  nvidia-kernel-source-440 nvidia-prime nvidia-settings ocl-icd-libopencl1 pkg-config screen-resolution-extra
  xserver-xorg-video-nvidia-440
0 actualizados, 0 nuevos se instalarán, 75 para eliminar y 0 no actualizados.
Se liberarán 1.350 MB después de esta operación.
¿Desea continuar? [S/n] s
(Leyendo la base de datos ... 268024 ficheros o directorios instalados actualmente.)
Desinstalando gedit-common (3.28.1-1ubuntu1.2) ...
Desinstalando gedit-plugins-common (3.28.1-1) ...
Desinstalando gir1.2-ggit-1.0:amd64 (0.26.2-1) ...
Desinstalando gir1.2-gtksource-3.0:amd64 (3.24.7-1+elementary6~ubuntu5.0.1) ...
Desinstalando gir1.2-peas-1.0:amd64 (1.22.0-2) ...
Desinstalando lib32gcc1 (1:8.4.0-1ubuntu1~18.04) ...
Desinstalando libnvidia-fbc1-440:i386 (440.59-0ubuntu0.18.04.1) ...
Desinstalando libgl1:i386 (1.0.0-2ubuntu2.3) ...
Desinstalando libglx0:i386 (1.0.0-2ubuntu2.3) ...
Desinstalando libglx-mesa0:i386 (19.2.8-0ubuntu0~18.04.3) ...
Desinstalando libgl1-mesa-dri:i386 (19.2.8-0ubuntu0~18.04.3) ...
Desinstalando libllvm9:i386 (1:9-2~ubuntu18.04.2) ...
Desinstalando libatomic1:i386 (8.4.0-1ubuntu1~18.04) ...
Desinstalando libnvidia-encode-440:i386 (440.59-0ubuntu0.18.04.1) ...
Desinstalando libnvidia-decode-440:i386 (440.59-0ubuntu0.18.04.1) ...
Desinstalando libxxf86vm1:i386 (1:1.1.4-1) ...
Desinstalando libxcb-sync1:i386 (1.13-2~ubuntu18.04) ...
Desinstalando libc6-i386 (2.27-3ubuntu1) ...
Desinstalando libdrm-amdgpu1:i386 (2.4.99-1ubuntu1~18.04.2) ...
Desinstalando libdrm-intel1:i386 (2.4.99-1ubuntu1~18.04.2) ...
Desinstalando libdrm-nouveau2:i386 (2.4.99-1ubuntu1~18.04.2) ...
Desinstalando libdrm-radeon1:i386 (2.4.99-1ubuntu1~18.04.2) ...
Desinstalando libdrm2:i386 (2.4.99-1ubuntu1~18.04.2) ...
Desinstalando libedit2:i386 (3.1-20170329-1) ...
Desinstalando libelf1:i386 (0.170-0.4ubuntu0.1) ...
Desinstalando libexpat1:i386 (2.2.5-3ubuntu0.2) ...
Desinstalando libffi6:i386 (3.2.1-8) ...
Desinstalando libglapi-mesa:i386 (19.2.8-0ubuntu0~18.04.3) ...
Desinstalando libglvnd0:i386 (1.0.0-2ubuntu2.3) ...
Desinstalando libido3-0.1-0:amd64 (13.10.0+17.04.20161028-0ubuntu1) ...
Desinstalando libllvm8:amd64 (1:8-3~ubuntu18.04.2) ...
Desinstalando xserver-xorg-video-nvidia-440 (440.59-0ubuntu0.18.04.1) ...
Desinstalando libnvidia-cfg1-440:amd64 (440.59-0ubuntu0.18.04.1) ...
Desinstalando libnvidia-common-440 (440.59-0ubuntu0.18.04.1) ...
Desinstalando libnvidia-encode-440:amd64 (440.59-0ubuntu0.18.04.1) ...
Desinstalando libnvidia-decode-440:amd64 (440.59-0ubuntu0.18.04.1) ...
Desinstalando libnvidia-compute-440:amd64 (440.59-0ubuntu0.18.04.1) ...
Desinstalando libnvidia-compute-440:i386 (440.59-0ubuntu0.18.04.1) ...
Desinstalando libnvidia-fbc1-440:amd64 (440.59-0ubuntu0.18.04.1) ...
Desinstalando libpciaccess0:i386 (0.14-1) ...
Desinstalando libsensors4:i386 (1:3.4.0-4) ...
Desinstalando libstdc++6:i386 (8.4.0-1ubuntu1~18.04) ...
Desinstalando libx11-xcb1:i386 (2:1.6.4-3ubuntu0.2) ...
Desinstalando libxcb-dri2-0:i386 (1.13-2~ubuntu18.04) ...
Desinstalando libxcb-dri3-0:i386 (1.13-2~ubuntu18.04) ...
Desinstalando libxcb-glx0:i386 (1.13-2~ubuntu18.04) ...
Desinstalando libxcb-present0:i386 (1.13-2~ubuntu18.04) ...
Desinstalando libxdamage1:i386 (1:1.1.4-3) ...
Desinstalando libxext6:i386 (2:1.3.3-1) ...
Desinstalando libxfixes3:i386 (1:5.0.3-1) ...
Desinstalando nvidia-settings (440.44-0ubuntu0.18.04.1) ...
Desinstalando libxnvctrl0:amd64 (440.44-0ubuntu0.18.04.1) ...
Desinstalando libxshmfence1:i386 (1.3-1) ...
Desinstalando linux-headers-5.0.0-37-generic (5.0.0-37.40~18.04.1) ...
Desinstalando linux-headers-5.0.0-37 (5.0.0-37.40~18.04.1) ...
Desinstalando linux-headers-5.3.0-51-generic (5.3.0-51.44~18.04.2) ...
Desinstalando linux-headers-5.3.0-51 (5.3.0-51.44~18.04.2) ...
Desinstalando linux-modules-extra-5.0.0-37-generic (5.0.0-37.40~18.04.1) ...
Desinstalando linux-image-5.0.0-37-generic (5.0.0-37.40~18.04.1) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.0.0-37-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Generando un fichero de configuración de grub...
Encontrada imagen de linux: /boot/vmlinuz-5.3.0-59-generic
Encontrada imagen de memoria inicial: /boot/initrd.img-5.3.0-59-generic
Encontrada imagen de linux: /boot/vmlinuz-5.3.0-53-generic
Encontrada imagen de memoria inicial: /boot/initrd.img-5.3.0-53-generic
Encontrada imagen de linux: /boot/vmlinuz-5.3.0-51-generic
Encontrada imagen de memoria inicial: /boot/initrd.img-5.3.0-51-generic
Encontrado Windows 10 en /dev/sda1
hecho
Desinstalando linux-modules-extra-5.3.0-51-generic (5.3.0-51.44~18.04.2) ...
Desinstalando linux-image-5.3.0-51-generic (5.3.0-51.44~18.04.2) ...
/etc/kernel/postrm.d/initramfs-tools:
update-initramfs: Deleting /boot/initrd.img-5.3.0-51-generic
/etc/kernel/postrm.d/zz-update-grub:
Sourcing file `/etc/default/grub'
Generando un fichero de configuración de grub...
Encontrada imagen de linux: /boot/vmlinuz-5.3.0-59-generic
Encontrada imagen de memoria inicial: /boot/initrd.img-5.3.0-59-generic
Encontrada imagen de linux: /boot/vmlinuz-5.3.0-53-generic
Encontrada imagen de memoria inicial: /boot/initrd.img-5.3.0-53-generic
File descriptor 10 (/var/lib/dpkg/triggers/linux-update-5.0.0-37-generic (deleted)) leaked on lvs invocation. Parent PID 8112: /bin/sh
Encontrado Windows 10 en /dev/sda1
hecho
Desinstalando linux-modules-5.0.0-37-generic (5.0.0-37.40~18.04.1) ...
Desinstalando linux-modules-5.3.0-51-generic (5.3.0-51.44~18.04.2) ...
Desinstalando nvidia-dkms-440 (440.59-0ubuntu0.18.04.1) ...
Removing all DKMS Modules
Done.
INFO:Disable nvidia
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/lenovo_thinkpad
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/dell_latitude
DEBUG:Parsing /usr/share/ubuntu-drivers-common/quirks/put_your_quirks_here
update-initramfs: deferring update (trigger activated)
Desinstalando nvidia-kernel-common-440 (440.59-0ubuntu0.18.04.1) ...
update-initramfs: deferring update (trigger activated)
Desinstalando nvidia-kernel-source-440 (440.59-0ubuntu0.18.04.1) ...
Desinstalando nvidia-prime (0.8.8.2) ...
Desinstalando ocl-icd-libopencl1:amd64 (2.2.11-1ubuntu1) ...
Desinstalando pkg-config (0.29.1-0ubuntu2) ...
Desinstalando screen-resolution-extra (0.17.3) ...
Desinstalando libx11-6:i386 (2:1.6.4-3ubuntu0.2) ...
Desinstalando libxcb1:i386 (1.13-2~ubuntu18.04) ...
Desinstalando libxdmcp6:i386 (1:1.1.2-3) ...
Desinstalando libbsd0:i386 (0.8.7-1ubuntu0.1) ...
Desinstalando libxau6:i386 (1:1.0.8-1) ...
Procesando disparadores para desktop-file-utils (0.23-1ubuntu3.18.04.2+elementary2~ubuntu5.0.1) ...
Procesando disparadores para libglib2.0-0:amd64 (2.56.4-0ubuntu0.18.04.6) ...
No existe la clave «button-layout» en el esquema «org.gnome.mutter:Pantheon» como se especificó en el archivo de sobrescritura «/usr/share/glib-2.0/schemas/20_elementary.pantheon.wm.gschema.override»; ignorando la sobrescritura para esta clave.
No existe la clave «enable-animations» en el esquema «org.gnome.mutter:Pantheon» como se especificó en el archivo de sobrescritura «/usr/share/glib-2.0/schemas/20_elementary.pantheon.wm.gschema.override»; ignorando la sobrescritura para esta clave.
Procesando disparadores para initramfs-tools (0.130ubuntu3.9) ...
update-initramfs: Generating /boot/initrd.img-5.3.0-59-generic
I: The initramfs will attempt to resume from /dev/sda6
I: (UUID=06c6f90c-835b-4330-8aeb-44ebeaf7bed3)
I: Set the RESUME variable to override this.
Procesando disparadores para bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu1) ...
Rebuilding /usr/share/applications/bamf-2.index...
Procesando disparadores para libc-bin (2.27-3ubuntu1) ...
Procesando disparadores para doc-base (0.10.8) ...
Procesando 1 archivo doc-base eliminado...
Procesando disparadores para man-db (2.8.3-2ubuntu0.1) ...
Procesando disparadores para gnome-menus (3.13.3-11ubuntu1.1) ...
Procesando disparadores para dbus (1.12.2-1ubuntu1.1) ...
Procesando disparadores para hicolor-icon-theme (0.17-2) ...
Procesando disparadores para mime-support (3.60ubuntu1) ...

完成之后,APT 又可以正常工作了,我再也不想安装 NVIDIA 了!XD 感谢我的朋友们


相关内容