由于显卡驱动程序导致包管理器损坏

由于显卡驱动程序导致包管理器损坏

我的包管理系统似乎坏了。

在我看来,原因好像在于我的显卡的专有 NVIDIA 驱动程序(nvidia-driver-390,专有,已测试),但当我尝试恢复到默认的 X.Org X 服务器时,每当我返回“软件和更新”时,都没有发生任何变化。

这是我尝试安装包时收到的输出:

 sudo apt-get install birdfont
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:
 birdfont : Depends: libxmlbird1 but it is not going to be installed
            Depends: fonts-roboto but it is not going to be installed
            Recommends: unicode-data but it is not going to be installed
 **libnvidia-ifr1-390 : Depends: libnvidia-gl-390 but it is not going to be installed**
 libnvidia-ifr1-390:i386 : Depends: libnvidia-gl-390:i386 but it is not going to be installed
 **nvidia-driver-390 : Depends: libnvidia-gl-390 (= 390.48-0ubuntu3) but it is not going to be installed**
                     Recommends: libnvidia-gl-390:i386 (= 390.48-0ubuntu3)
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specify a solution)

sudo apt-get install -f 的输出

    sudo apt-get install -f
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:
  clamav-base clamav-freshclam lib32gcc1 libc6-i386 libclamav7 libgsoap-2.8.60 libllvm3.9 libqt5opengl5
  libtext-csv-perl libtext-csv-xs-perl libtfm1 libvncserver1 xserver-xorg-legacy
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libnvidia-gl-390 libnvidia-gl-390:i386
The following NEW packages will be installed:
  libnvidia-gl-390 libnvidia-gl-390:i386
0 upgraded, 2 newly installed, 0 to remove and 37 not upgraded.
3 not fully installed or removed.
Need to get 29.1 MB of archives.
After this operation, 147 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://il.archive.ubuntu.com/ubuntu bionic/restricted i386 libnvidia-gl-390 i386 390.48-0ubuntu3 [14.9 MB]
Get:2 http://il.archive.ubuntu.com/ubuntu bionic/restricted amd64 libnvidia-gl-390 amd64 390.48-0ubuntu3 [14.3 MB]
Fetched 29.1 MB in 9s (3,325 kB/s)                                                                      
(Reading database ... 253938 files and directories currently installed.)
Preparing to unpack .../libnvidia-gl-390_390.48-0ubuntu3_i386.deb ...
diversion of /usr/lib/i386-linux-gnu/libGL.so to /usr/lib/i386-linux-gnu/libGL.so.distrib by nvidia-340
dpkg-divert: error: mismatch on package
  when removing 'diversion of /usr/lib/i386-linux-gnu/libGL.so by libnvidia-gl-390'
  found 'diversion of /usr/lib/i386-linux-gnu/libGL.so to /usr/lib/i386-linux-gnu/libGL.so.distrib by nvidia-340'
dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_i386.deb (--unpack):
 new libnvidia-gl-390:i386 package pre-installation script subprocess returned error exit status 2
Preparing to unpack .../libnvidia-gl-390_390.48-0ubuntu3_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-390'
  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-390_390.48-0ubuntu3_amd64.deb (--unpack):
 new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_i386.deb
 /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

`

**sudo apt -fix-broken install**
sudo 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:
  clamav-base clamav-freshclam lib32gcc1 libc6-i386 libclamav7 libgsoap-2.8.60
  libllvm3.9 libqt5opengl5 libtext-csv-perl libtext-csv-xs-perl libtfm1
  libvncserver1 xserver-xorg-legacy
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  libnvidia-gl-390 libnvidia-gl-390:i386
The following NEW packages will be installed:
  libnvidia-gl-390 libnvidia-gl-390:i386
0 upgraded, 2 newly installed, 0 to remove and 37 not upgraded.
3 not fully installed or removed.
Need to get 0 B/29.1 MB of archives.
After this operation, 147 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
(Reading database ... 253938 files and directories currently installed.)
Preparing to unpack .../libnvidia-gl-390_390.48-0ubuntu3_i386.deb ...
diversion of /usr/lib/i386-linux-gnu/libGL.so to /usr/lib/i386-linux-gnu/libGL.so.distrib by nvidia-340
dpkg-divert: error: mismatch on package
  when removing 'diversion of /usr/lib/i386-linux-gnu/libGL.so by libnvidia-gl-390'
  found 'diversion of /usr/lib/i386-linux-gnu/libGL.so to /usr/lib/i386-linux-gnu/libGL.so.distrib by nvidia-340'
dpkg: error processing archive /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_i386.deb (--unpack):
 new libnvidia-gl-390:i386 package pre-installation script subprocess returned error exit status 2
Preparing to unpack .../libnvidia-gl-390_390.48-0ubuntu3_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-390'
  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-390_390.48-0ubuntu3_amd64.deb (--unpack):
 new libnvidia-gl-390:amd64 package pre-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_i386.deb
 /var/cache/apt/archives/libnvidia-gl-390_390.48-0ubuntu3_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

我尝试了推荐的命令但问题仍未解决。

有什么想法可以帮助解决问题吗?

答案1

非正统解决方案:尝试手动删除 Nvidia 软件包并且自动删除均失败,但从互联网上下载 .deb 并使用 gdebi 似乎已删除有问题的软件包并将我的软件包管理器还给我!

sudo gdebi birdfont_2.21.1+git8ae0c56f-1_amd64.deb 
Reading package lists... Done
Building dependency tree        
Reading state information... Done
Reading state information... Done
**Requires the REMOVAL of the following packages: libnvidia-ifr1-390 libnvidia-ifr1-390:i386 nvidia-driver-390** 
Requires the installation of the following packages: fonts-roboto libxmlbird1 

font editor that lets you create outline vector graphics and export fonts
 Birdfont is a free, open source font editor that lets you create outline
 vector graphics and export ttf, eot & svg fonts.
Do you want to install the software package? [y/N]:y
Get:1 http://il.archive.ubuntu.com/ubuntu bionic/universe amd64 fonts-roboto all 2:0~20160106-2 [2294 B]
Get:2 http://il.archive.ubuntu.com/ubuntu bionic/universe amd64 libxmlbird1 amd64 1.2.9-1 [26.0 kB]
Fetched 28.3 kB in 0s (0 B/s)                                                  
(Reading database ... 253937 files and directories currently installed.)
**Removing nvidia-driver-390 (390.48-0ubuntu3) ...
Removing libnvidia-ifr1-390:amd64 (390.48-0ubuntu3) ...
Removing libnvidia-ifr1-390:i386 (390.48-0ubuntu3) ...**
Selecting previously unselected package fonts-roboto.
(Reading database ... 253872 files and directories currently installed.)
Preparing to unpack .../fonts-roboto_2%3a0~20160106-2_all.deb ...
Unpacking fonts-roboto (2:0~20160106-2) ...
Selecting previously unselected package libxmlbird1:amd64.
Preparing to unpack .../libxmlbird1_1.2.9-1_amd64.deb ...
Unpacking libxmlbird1:amd64 (1.2.9-1) ...
Setting up fonts-roboto (2:0~20160106-2) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Setting up libxmlbird1:amd64 (1.2.9-1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Selecting previously unselected package birdfont.
(Reading database ... 253882 files and directories currently installed.)
Preparing to unpack birdfont_2.21.1+git8ae0c56f-1_amd64.deb ...
Unpacking birdfont (2.21.1+git8ae0c56f-1) ...
Setting up birdfont (2.21.1+git8ae0c56f-1) ...
Processing triggers for libc-bin (2.27-3ubuntu1) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.1) ...
Processing triggers for mime-support (3.60ubuntu1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for man-db (2.8.3-2) ...
Processing triggers for shared-mime-info (1.9-2) ...

(更新:安装每日更新后,包管理器再次损坏,大概是重新添加了有问题的包。从那以后就一直兜圈子。)

相关内容