在 Debian 上安装 nvidia 驱动程序后,dpkg、X 损坏

在 Debian 上安装 nvidia 驱动程序后,dpkg、X 损坏

在遵循 Debian适用于 Debian 8“Jessie”的 NVidia 驱动程序安装说明,我遇到了一个障碍,我无法弄清楚......

# apt-get install linux-headers-$(uname -r|sed 's,[^-]*-[^-]*-,,')
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 glx-alternative-mesa : Depends: glx-diversions (= 0.7.2) but 0.5.1 is to be installed
 linux-headers-amd64 : Depends: linux-headers-4.5.0-1-amd64 but it is not going to be installed
 update-glx : Depends: glx-diversions (= 0.7.2) but 0.5.1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
# apt-get -f 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:
  libjansson4 libxnvctrl0 nvidia-settings
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  glx-alternative-nvidia glx-diversions libegl1-nvidia libgl1-nvidia-glx libnvidia-eglcore
  nvidia-alternative nvidia-driver nvidia-driver-bin nvidia-kernel-common nvidia-kernel-dkms
  nvidia-kernel-support nvidia-legacy-check nvidia-vdpau-driver xserver-xorg-video-nvidia
Recommended packages:
  libgl1-nvidia-glx-i386 libgles1-nvidia libgles2-nvidia nvidia-persistenced
The following NEW packages will be installed:
  nvidia-kernel-support nvidia-legacy-check
The following packages will be upgraded:
  glx-alternative-nvidia glx-diversions libegl1-nvidia libgl1-nvidia-glx libnvidia-eglcore
  nvidia-alternative nvidia-driver nvidia-driver-bin nvidia-kernel-common nvidia-kernel-dkms
  nvidia-vdpau-driver xserver-xorg-video-nvidia
12 upgraded, 2 newly installed, 0 to remove and 1090 not upgraded.
2 not fully installed or removed.
Need to get 0 B/23.3 MB of archives.
After this operation, 4,727 kB disk space will be freed.
Do you want to continue? [Y/n] 
Reading changelogs... Done
Preconfiguring packages ...
(Reading database ... 249357 files and directories currently installed.)
Preparing to unpack .../nvidia-legacy-check_352.79-6_amd64.deb ...
dpkg: error processing archive /var/cache/apt/archives/nvidia-legacy-check_352.79-6_amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 128
Errors were encountered while processing:
 /var/cache/apt/archives/nvidia-legacy-check_352.79-6_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

好的...那么“错误退出状态 128”是什么意思?

# dpkg -Dh
dpkg debugging option, --debug=<octal> or -D<octal>:

 Number  Ref. in source   Description
      1  general          Generally helpful progress information
      2  scripts          Invocation and status of maintainer scripts
     10  eachfile         Output for each file processed
    100  eachfiledetail   Lots of output for each file processed
     20  conff            Output for each configuration file
    200  conffdetail      Lots of output for each configuration file
     40  depcon           Dependencies and conflicts
    400  depcondetail     Lots of dependencies/conflicts output
  10000  triggers         Trigger activation and processing
  20000  triggersdetail   Lots of output regarding triggers
  40000  triggersstupid   Silly amounts of output regarding triggers
   1000  veryverbose      Lots of drivel about eg the dpkg/info directory
   2000  stupidlyverbose  Insane amounts of drivel

Debugging options can be mixed using bitwise-or.
Note that the meanings and values are subject to change.
# dpkg -D2000 --install /var/cache/apt/archives/nvidia-legacy-check_352.79-6_amd64.deb
(Reading database ... 249357 files and directories currently installed.)
Preparing to unpack .../nvidia-legacy-check_352.79-6_amd64.deb ...
dpkg: error processing archive /var/cache/apt/archives/nvidia-legacy-check_352.79-6_amd64.deb (--install):
 subprocess new pre-installation script returned error exit status 128
Errors were encountered while processing:
 /var/cache/apt/archives/nvidia-legacy-check_352.79-6_amd64.deb
#

嗯……所以,没有任何信息。

有人可以提供建议吗?在问题得到解决之前,我根本无法安装任何东西或使用 apt-get,因为我总是被要求运行“-f install”。

我很乐意“清除”我能清除的内容并重新开始,但不知道如何到达那里。 glx-diversions 的依赖冲突似乎无法克服......

# apt-get -f install glx-diversions=0.5.1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
glx-diversions is already the newest version.
glx-diversions set to manually installed.
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 glx-alternative-mesa : Depends: glx-diversions (= 0.7.2) but 0.5.1 is to be installed
 update-glx : Depends: glx-diversions (= 0.7.2) but 0.5.1 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

# apt-get remove glx-alternative-mesa update-glx
Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 glx-alternative-nvidia : Depends: glx-alternative-mesa but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

帮助?

更新: 资料来源如下:

# cat sources.list
deb http://ftp.us.debian.org/debian testing main contrib non-free

deb http://ftp.debian.org/debian/ jessie-updates main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free

# jessie-backports
deb http://httpredir.debian.org/debian jessie-backports main contrib non-free

....哦哦是的。 “测试”!=“杰西”。将“testing”更改为“jessie”现在,当我运行 apt-get -f install 时,会发生很多新的、好的事情,并且它会毫无错误地完成。谢谢。

答案1

当您安装了 2 个不同的体系结构或同一软件包的版本时,您会收到该错误。如果apt-get -f install尝试使用该应用程序时仍然出现错误synaptic(在左列损坏的软件包上),您可以解决问题。

相关内容