我现在在 18.04,即将升级到 20.04。我的包管理器为我提供了部分升级和 dist 升级作为选项。我认为最好先运行部分升级并尝试在升级到 20.04 之前解决任何未解决的问题。这似乎已经破坏了我的系统。重新启动后,它只是挂起并且永远不会启动(我将其放置超过 24 小时,并且它从未从仅显示 /dev/sda1 干净的消息的黑白 TTY 中移动)。
我能够重新启动并选择以前的内核版本(5.4.0-51-generic),我的系统也启动了,但使用的是 nouveau 驱动程序,分辨率很荒谬。不幸的是,显示选项没有提供任何更改它的选项,所以我尝试安装 nvidia 专有驱动程序(同样——它们以前已安装)。我仍然可以使用旧内核启动,但我似乎无法修复损坏的软件包。例如:
$ sudo apt install nvidia-driver-455
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-gl-450-server : Depends: libnvidia-common-450-server but it is not going to be installed
libnvidia-gl-450-server:i386 : Depends: libnvidia-common-450-server:i386
nvidia-driver-455 : Depends: libnvidia-gl-455 (= 455.32.00-0ubuntu1) but it is not going to be installed
Depends: nvidia-dkms-455 (= 455.32.00-0ubuntu1) but it is not going to be installed
Depends: nvidia-kernel-source-455 (= 455.32.00-0ubuntu1) but it is not going to be installed
Depends: libnvidia-compute-455 (= 455.32.00-0ubuntu1) but it is not going to be installed
Depends: libnvidia-extra-455 (= 455.32.00-0ubuntu1) but it is not going to be installed
Depends: nvidia-compute-utils-455 (= 455.32.00-0ubuntu1) but it is not going to be installed
Depends: libnvidia-decode-455 (= 455.32.00-0ubuntu1) but it is not going to be installed
Depends: libnvidia-encode-455 (= 455.32.00-0ubuntu1) but it is not going to be installed
Depends: nvidia-utils-455 (= 455.32.00-0ubuntu1) but it is not going to be installed
Depends: xserver-xorg-video-nvidia-455 (= 455.32.00-0ubuntu1) but it is not going to be installed
Depends: libnvidia-cfg1-455 (= 455.32.00-0ubuntu1) but it is not going to be installed
Depends: libnvidia-ifr1-455 (= 455.32.00-0ubuntu1) but it is not going to be installed
Depends: libnvidia-fbc1-455 (= 455.32.00-0ubuntu1) but it is not going to be installed
Recommends: libnvidia-compute-455:i386 (= 455.32.00-0ubuntu1)
Recommends: libnvidia-decode-455:i386 (= 455.32.00-0ubuntu1)
Recommends: libnvidia-encode-455:i386 (= 455.32.00-0ubuntu1)
Recommends: libnvidia-ifr1-455:i386 (= 455.32.00-0ubuntu1)
Recommends: libnvidia-fbc1-455:i386 (= 455.32.00-0ubuntu1)
Recommends: libnvidia-gl-455:i386 (= 455.32.00-0ubuntu1)
$ sudo apt --fix-broken install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
libnvidia-common-450
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
libnvidia-common-450-server
The following NEW packages will be installed:
libnvidia-common-450-server
0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.
5 not fully installed or removed.
Need to get 9,928 B of archives.
After this operation, 35.8 kB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 http://us.archive.ubuntu.com/ubuntu bionic-updates/multiverse amd64 libnvidia-common-450-server all 450.80.02-0ubuntu0.18.04.3 [9,928 B]
Fetched 9,928 B in 0s (88.0 kB/s)
(Reading database ... 282148 files and directories currently installed.)
Preparing to unpack .../libnvidia-common-450-server_450.80.02-0ubuntu0.18.04.3_all.deb ...
Unpacking libnvidia-common-450-server (450.80.02-0ubuntu0.18.04.3) ...
dpkg: error processing archive /var/cache/apt/archives/libnvidia-common-450-server_450.80.02-0ubuntu0.18.04.3_all.deb (--unpack):
trying to overwrite '/usr/share/nvidia/nvidia-application-profiles-450.80.02-key-documentation', which is also in package libnvidia-common-450 450.80.02-0ubuntu1
Errors were encountered while processing:
/var/cache/apt/archives/libnvidia-common-450-server_450.80.02-0ubuntu0.18.04.3_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我如何在这里恢复运行?我可以在 18.04 上修复这里的问题,还是直接使用 20.04 USB 密钥启动并告诉它升级我现有的安装?我试过跑步apt autoclean
,apt clean
但那些也无济于事。
我通过简单地尝试删除
libnvidia-gl-450-server
包来解决这个问题libnvidia-gl-450-server:i386
,然后它会抱怨包,然后会抱怨另一个包,等等。我不断重新运行命令,添加它抱怨的每个新包,直到我终于得到需要删除的软件包的完整列表。最终,这恰好是我的清单,但它可能会因您的系统和/或损坏的软件包而异:然后我跑了
sudo apt update
,它成功完成了。我安装了所有等待的更新,重新启动了我的机器(因为有内核更新),现在它可以在最新内核上使用功能性 nvidia 驱动程序正常启动,并且我的包系统已修复。我现在将继续进行 LTS 更新。首先,阅读您刚刚运行的命令的输出:
...现在就这样做,据我所知,这是一个明智的选择。
如果这没有帮助,则删除有问题的包;IE
其次是清理剩余部分的选项。例如
例如,第一行的包名称
libnvidia-gl-450-server:i386
可能表明您使用的是 32 位系统 - 即通过显示:386
.我很确定已经阅读了基本 Ubuntu 已放弃 32 位系统支持:如果您确实正在尝试升级 32 位系统;您可能需要查找仍然支持旧架构的另一个发行版。
如果不是这种情况,请尝试其他 nvidia 驱动程序包,甚至是 nvidia 提供的运行时(从故障恢复控制台运行它!),假设有适合硬件的版本。