我正在尝试删除一个包:sudo apt-get remove pgbouncer
但是却出现以下错误:
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-server : Depends: linux-image-server (= 3.2.0.44.53) but 3.2.0.45.54 is to be installed
Depends: linux-headers-server (= 3.2.0.44.53) but 3.2.0.45.54 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
我尝试过sudo 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:
linux-headers-3.2.0-38 linux-image-3.2.0-38-generic libpgpool0 linux-headers-3.2.0-38-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
linux-server
The following packages will be upgraded:
linux-server
1 upgraded, 0 newly installed, 0 to remove and 60 not upgraded.
1 not fully installed or removed.
Need to get 0 B/1,732 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-server:
linux-server depends on linux-image-server (= 3.2.0.44.53); however:
Version of linux-image-server on system is 3.2.0.45.54.
linux-server depends on linux-headers-server (= 3.2.0.44.53); however:
Version of linux-headers-server on system is 3.2.0.45.54.
dpkg: error processing linux-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
linux-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
我怎样才能解决这个恼人的问题?
答案1
http://www.iasptk.com/ubuntu-fix-broken-package-best-solution
尝试后
sudo dpkg --configure -a
和
sudo apt-get install -f
损坏软件包的问题仍然存在,解决方案是手动编辑 dpkg 状态文件。
sudo gedit /var/lib/dpkg/status
(你可以使用 vi 或 nano 代替 gedit)
找到损坏的包,删除有关它的整个信息块并保存文件。
如果这对你没用...请继续