今天我去奶奶家,因为她的电脑出了点问题,运行的是 Xubuntu 12.04LTS。修复“问题”后(Firefox 设置为全屏...),我运行了常规程序apt-get update && apt-get dist-upgrade
立即更新所有内容。但我收到一个错误,提示某些软件包安装不正确。于是我运行了dpkg --configure -a
。我猜是因为 Firefox 是全屏的,她不知道如何关闭电脑,就直接关机了,很可能是在安装自动安全更新的时候。dpkg --configure -a
但是运行后只给我留下了一条错误消息,提示未满足依赖项linux-generic
。再次运行时apt-get dist-upgrade
,它告诉我同样的情况,我应该尝试该-f
选项。但是,即使在尝试强制升级时,它仍然无法安装它们。
这是命令的输出(添加 LANG=C 因为默认语言是荷兰语)。
jeroen@Bomma:/home/bomma$ LANG=C sudo apt-get dist-upgrade
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:
linux-generic : Depends: linux-image-generic (= 3.2.0.37.45) but 3.2.0.38.46 is installed
Depends: linux-headers-generic (= 3.2.0.37.45) but 3.2.0.38.46 is installed
E: Unmet dependencies. Try using -f.
使用以下命令运行-f
:
jeroen@Bomma:/home/bomma$ LANG=C sudo apt-get -f dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
Calculating upgrade... Done
The following packages will be upgraded:
linux-generic
1 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
Need to get 0 B/1.722 B of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]?
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 3.2.0.37.45); however:
Version of linux-image-generic on system is 3.2.0.38.46.
linux-generic depends on linux-headers-generic (= 3.2.0.37.45); however:
Version of linux-headers-generic on system is 3.2.0.38.46.
dpkg: error processing linux-generic (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Errors were encountered while processing:
linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
我不知道该如何解决这个问题(除了快速重新安装她漂亮的默认 xubuntu)?尝试删除并重新安装该linux-generic
软件包似乎相当冒险,但也许这样可以解决问题?
答案1
删除linux-generic
不会有任何坏处。它只是一个依赖于linux-image-generic
和的“元包” linux-headers-generic
。这两个包本身就是依赖于各自最新的 image/headers 包的元包。
apt-cache show linux-generic
您可以通过发出、apt-cache show linux-image-generic
和 来亲自查看这一点apt-cache show linux-headers-generic
。
元软件包的目的是引入它们所依赖的软件包,它们根本没有任何功能。另一方面,删除一个元软件包将不是删除它的依赖项-这样对系统就不会有危险了。
解决原始问题后,您当然可以linux-generic
再次安装。