我正在 UbuntuUbuntu 12.04.2 LTS (GNU/Linux 3.5.0-43-generic x86_64)
机器上工作。
我需要安装一些软件包,为了能够安装这些软件包,首先我必须运行apt-get -f install
.
但这是我跑步时得到的结果apt-get -f install
:
root@SERVERLINUX:/boot# 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:
firefox-globalmenu python2.6-minimal linux-headers-3.5.0-39-generic linux-headers-3.5.0-34 linux-headers-3.5.0-37
linux-headers-3.5.0-39 thunderbird-globalmenu linux-headers-3.5.0-34-generic linux-headers-3.5.0-37-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
linux-image-generic-lts-quantal
The following packages will be upgraded:
linux-image-generic-lts-quantal
1 upgraded, 0 newly installed, 0 to remove and 440 not upgraded.
2 not fully installed or removed.
Need to get 0 B/2.442 B 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 linux-image-generic-lts-quantal:
linux-image-generic-lts-quantal depends on linux-image-3.5.0-44-generic; however:
Package linux-image-3.5.0-44-generic is not installed.
dpkg: error processing linux-image-generic-lts-quantal (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic-lts-quantal:
linux-generic-lts-quantal depends on linux-image-generic-lts-quantal; however:
Package linux-image-generic-lts-quantal is not configured yet.
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because the error message indicates its a followup error from a previous failure.
dpkg: error processing linux-generic-lts-quantal (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-image-generic-lts-quantal
linux-generic-lts-quantal
E: Sub-process /usr/bin/dpkg returned an error code (1)
这是怎么回事?我怎样才能apt-get -f install
成功运行?我该如何解决这些依赖错误?
编辑:
这是我跑步时得到的结果dpkg --configure -a
,正如 Mohsen Pahlavanzadeh 所建议的:
root@SERVERLINUX:/boot# dpkg --configure -a
dpkg: dependency problems prevent configuration of linux-image-generic-lts-quantal:
linux-image-generic-lts-quantal depends on linux-image-3.5.0-44-generic; however:
Package linux-image-3.5.0-44-generic is not installed.
dpkg: error processing linux-image-generic-lts-quantal (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic-lts-quantal:
linux-generic-lts-quantal depends on linux-image-generic-lts-quantal; however:
Package linux-image-generic-lts-quantal is not configured yet.
dpkg: error processing linux-generic-lts-quantal (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-image-generic-lts-quantal
linux-generic-lts-quantal
答案1
跑步
apt-get install linux-image-3.5.0-44-generic.
解决了海报的问题。
答案2
同样的错误后:
apt-get update ### for resynchronize with your server
apt-get -f install ### fixing your problem
####And if your problem stay still you have two way:
####at first run :
dpkg --configure -a ### becuase after apt-get update , error of apt-get -f install may be changed
### two: wait to server will be changed
答案3
对我来说,解决方案是不同的。
我使用了该命令aptitude
,当图形菜单出现时,我常常/
会弹出一个搜索字段并找到所有linux-header
, linux-image
,linux-server
版本,并通过按 删除当前未使用的版本之外的所有版本-
。
为了找到我使用的当前内核版本uname -r
。
linux-{header, image, server}
最后,我通过选择它们并按指定的顺序安装了较新版本的+
。
为了确认我使用的更新u
。
最后我重新启动,一切都修复了。
答案4
添加force-all
到/etc/dpkg/dpkg.cfg
应该修复它:
# echo "force-all" > /etc/dpkg/dpkg.cfg
# apt-get -f install