我在摆弄 nvidia 驱动程序试图让外接显示器工作时,导致 apt-upgrade 中断。
当我运行时sudo apt upgrade
,我得到:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
然后我这样做- sudo apt --fix-broken install
,我得到:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Correcting dependencies... Done
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
22 not fully installed or removed.
Need to get 0 B/11.4 kB of archives.
After this operation, 0 B of additional disk space will be used.
dpkg: dependency problems prevent configuration of libxcb1:i386:
libxcb1:i386 depends on libxdmcp6; however:
Package libxdmcp6:i386 is not installed.
.
.
.
.
dpkg: error processing package libnvidia-gl-515:i386 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libnvidia-encode-515:i386:
libnvidia-encode-515:i386 depends on libnvidia-decode-515; however:
Package libnvidia-decode-515:i386 is not configured yet.
dpkg: error processing package libnvidia-encode-515:i386 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
libxcb1:i386
libglx-mesa0:i386
libxcb-xfixes0:i386
libglx0:i386
libxcb-glx0:i386
libxcb-shm0:i386
libxcb-present0:i386
libgl1:i386
libxcb-sync1:i386
libxcb-dri2-0:i386
libx11-6:i386
libnvidia-fbc1-515:i386
libxcb-dri3-0:i386
libx11-xcb1:i386
libgl1-mesa-dri:i386
libxext6:i386
libxxf86vm1:i386
libxfixes3:i386
libnvidia-decode-515:i386
libnvidia-gl-515:i386
libnvidia-encode-515:i386
E: Sub-process /usr/bin/dpkg returned an error code (1)
我在网上看到sudo dpkg --configure -a
应该有帮助的,但实际上没有。给出了一个错误:
dpkg: dependency problems prevent configuration of libxcb1:i386:
libxcb1:i386 depends on libxdmcp6; however:
Package libxdmcp6:i386 is not installed.
.
.
.
dpkg: error processing package libnvidia-encode-515:i386 (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
libxcb1:i386
libglx-mesa0:i386
libxcb-xfixes0:i386
libglx0:i386
libxcb-glx0:i386
libxcb-shm0:i386
libxcb-present0:i386
libgl1:i386
libxcb-sync1:i386
libxcb-dri2-0:i386
libx11-6:i386
libnvidia-fbc1-515:i386
libxcb-dri3-0:i386
libx11-xcb1:i386
libgl1-mesa-dri:i386
libxext6:i386
libxxf86vm1:i386
libxfixes3:i386
libnvidia-decode-515:i386
libnvidia-gl-515:i386
libnvidia-encode-515:i386
我在网上读到并发现了这一点,但它也没有帮助。
sudo dpkg --add-architecture i386
我按照类似帖子中的步骤进行操作这里但没有帮助。
运行第一个命令时sudo apt-get remove --purge nvidia*
,出现错误:
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'nvidia-cuda-toolkit-doc' for glob 'nvidia*'
Note, selecting 'nvidia-dkms-450-server' for glob 'nvidia*'
Note, selecting 'nvidia-headless-390' for glob 'nvidia*'
Note, selecting 'nvidia-cuda-toolkit-gcc' for glob 'nvidia*'
Note, selecting 'nvidia-headless-418' for glob 'nvidia*'
.
.
Package 'nvidia-opencl-icd-384' is not installed, so not removed
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libxcb1:i386 : Depends: libxdmcp6:i386 but it is not going to be installed
linux-modules-nvidia-515-5.19.0-32-generic : Depends: nvidia-kernel-common-515 (<= 515.86.01-1) but it is not going to be installed
Depends: nvidia-kernel-common-515 (>= 515.86.01) but it is not going to be installed
linux-modules-nvidia-515-generic-hwe-22.04 : Depends: nvidia-kernel-common-515 (<= 515.86.01-1) but it is not going to be installed
Depends: nvidia-kernel-common-515 (>= 515.86.01) but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
运行时sudo dpkg --remove --force-remove-reinstreq libxcb1:i386 linux-modules-nvidia-515-5.19.0-32-generic linux-modules-nvidia-515-generic-hwe-22.04
出现错误:
dpkg: dependency problems prevent removal of libxcb1:i386:
libxcb-xfixes0:i386 depends on libxcb1.
libxcb-sync1:i386 depends on libxcb1.
libxcb-shm0:i386 depends on libxcb1 (>= 1.12).
libxcb-present0:i386 depends on libxcb1.
libxcb-glx0:i386 depends on libxcb1.
libxcb-dri3-0:i386 depends on libxcb1 (>= 1.12).
libxcb-dri2-0:i386 depends on libxcb1.
libx11-6:i386 depends on libxcb1 (>= 1.11.1).
libglx-mesa0:i386 depends on libxcb1 (>= 1.9.2).
dpkg: error processing package libxcb1:i386 (--remove):
dependency problems - not removing
(Reading database ... 228713 files and directories currently installed.)
Removing linux-modules-nvidia-515-generic-hwe-22.04 (5.19.0-32.33~22.04.1) ...
Removing linux-modules-nvidia-515-5.19.0-32-generic (5.19.0-32.33~22.04.1) ...
linux-image-nvidia-5.19.0-32-generic: removing .ko files
Errors were encountered while processing:
libxcb1:i386
sudo apt install libxcb1
出现以下错误。运行后sudo apt --fix-broken install
出现与上述相同的错误。
libxcb1 is already the newest version (1.14-3ubuntu3).
libxcb1 set to manually installed.
You might want to run 'apt --fix-broken install' to correct these.
The following packages have unmet dependencies:
libxcb1:i386 : Depends: libxdmcp6:i386 but it is not going to be installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution).
sudo apt install libxdmcp6:i386 libxdmcp6
给出错误。
libxdmcp6 is already the newest version (1:1.1.3-0ubuntu5).
libxdmcp6 set to manually installed.
libxdmcp6:i386 is already the newest version (1:1.1.3-0ubuntu5).
The following packages were automatically installed and are no longer required:
dctrl-tools dkms libatomic1:i386 libdrm-amdgpu1:i386 libdrm-nouveau2:i386 libdrm-radeon1:i386 libdrm2:i386 libedit2:i386 libelf1:i386
libexpat1:i386 libffi8:i386 libgl1:i386 libgl1-mesa-dri:i386 libglapi-mesa:i386 libglvnd0:i386 libglx-mesa0:i386 libglx0:i386 libicu70:i386
libllvm15:i386 libnvidia-cfg1-525 libnvidia-common-525 libnvidia-compute-525:i386 libnvidia-decode-525 libnvidia-decode-525:i386
libnvidia-egl-wayland1 libnvidia-encode-525 libnvidia-encode-525:i386 libnvidia-extra-525 libnvidia-fbc1-525 libnvidia-fbc1-525:i386
libnvidia-gl-525 libnvidia-gl-525:i386 libsensors5:i386 libstdc++6:i386 libx11-6:i386 libx11-xcb1:i386 libxcb-dri2-0:i386 libxcb-dri3-0:i386
libxcb-glx0:i386 libxcb-present0:i386 libxcb-shm0:i386 libxcb-sync1:i386 libxcb-xfixes0:i386 libxcb1:i386 libxext6:i386 libxfixes3:i386
libxml2:i386 libxnvctrl0 libxshmfence1:i386 libxxf86vm1:i386 nvidia-compute-utils-525 nvidia-kernel-common-515 nvidia-kernel-source-525-open
nvidia-settings nvidia-utils-525 screen-resolution-extra xserver-xorg-video-nvidia-525
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.
22 not fully installed or removed.
Need to get 0 B/11.4 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
dpkg: dependency problems prevent configuration of libxcb1:i386:
libxcb1:i386 depends on libxdmcp6; however:
Package libxdmcp6:i386 is not installed.
.
.
.
dpkg: error processing package libnvidia-encode-525:i386 (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Errors were encountered while processing:
libxcb1:i386
libglx-mesa0:i386
libxcb-xfixes0:i386
libglx0:i386
libxcb-glx0:i386
libxcb-shm0:i386
libxcb-present0:i386
libgl1:i386
libxcb-sync1:i386
libxcb-dri2-0:i386
libx11-6:i386
libnvidia-decode-525:i386
libxcb-dri3-0:i386
libx11-xcb1:i386
libnvidia-fbc1-525:i386
libgl1-mesa-dri:i386
libnvidia-gl-525:i386
libxext6:i386
libxxf86vm1:i386
libxfixes3:i386
libnvidia-encode-525:i386
E: Sub-process /usr/bin/dpkg returned an error code (1)
我该如何解决?