Ubuntu

apt-get unmet dependencies,傳統解決方案不起作用

  • June 29, 2015

問題

採取任何將更改我的 Ubuntu 12.04 LTS 伺服器上已安裝軟體包的操作(刪除、安裝、清除等)都會失敗,並顯示:

Reading package lists...
Building dependency tree...
Reading state information...
Correcting dependencies... Done
The following extra packages will be installed:
 libpq-dev libssl-dev postgresql-9.1 postgresql-contrib-9.1
Suggested packages:
 oidentd ident-server locales-all libdbd-pg-perl
The following packages will be upgraded:
 libpq-dev libssl-dev postgresql-9.1 postgresql-contrib-9.1
4 to upgrade, 0 to newly install, 0 to remove and 4 not to upgrade.
7 not fully installed or removed.
Need to get 0 B/6,577 kB of archives.
After this operation, 6,144 B of additional disk space will be used.
dpkg: dependency problems prevent configuration of libssl-dev:
libssl-dev depends on libssl1.0.0 (= 1.0.1-4ubuntu5.27); however:
 Version of libssl1.0.0 on system is 1.0.1-4ubuntu5.31.
dpkg: error processing libssl-dev (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of libpq-dev:
libpq-dev depends on libpq5 (= 9.1.16-0ubuntu0.12.04); however:
 Version of libpq5 on system is 9.1.18-0ubuntu0.12.04.
libpq-dev depends on libssl-dev; however:
 Package libssl-dev is not configured yet.
dpkg: error processing libpq-dev (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-9.1:
postgresql-client-9.1 (9.1.18-0ubuntu0.12.04) breaks postgresql-9.1 (<< 9.1.18-0ubuntu0.12.04) and is installed.
 Version of postgresql-9.1 to be configured is 9.1.16-0ubuntu0.12.04.
dpkg: error processing postgresql-9.1 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-contrib-9.1:
postgresql-contrib-9.1 depends on postgresql-9.1 (= 9.1.16-0ubuntu0.12.04); however:
 Package postgresql-9.1 is not configured yet.
dpkg: error processing postgresql-contrib-9.1 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-server-dev-9.1:
postgresql-server-dev-9.1 depends on libpq-dev (>= 9.1~); however:
 Package libpq-dev is not configured yet.
dpkg: error processing postgresql-server-dev-9.1 (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python2.7-dev:
python2.7-dev depends on libssl-dev; however:
 Package libssl-dev is not configured yet.
dpkg: error processing python2.7-dev (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of python3.2-dev:
python3.2-dev depends on libssl-dev; however:
 Package libssl-dev is not configured yet.
dpkg: error processing python3.2-dev (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
libssl-dev
libpq-dev
postgresql-9.1
postgresql-contrib-9.1
postgresql-server-dev-9.1
python2.7-dev
python3.2-dev

可能的原因

我幾乎可以肯定最初的原因是完整的引導分區。但我現在已經通過dpkg -ring 一些舊核心清除了這一點。apt-get removing在使用與上述類似的堆棧跟踪失敗後,我使用了此方法。

問題的另一個潛在來源,雖然我認為不太可能,因為我看不到任何關係,是postgres 更新中的 Fsync 錯誤,我通過刪除證書的符號連結並按照說明直接複製證書來解決這個問題關聯。該錯誤與 apt-get 問題同時出現在我面前,所以我提到它是為了完整性,但正如我所說,我不知道它會如何破壞 apt-get。

我試過的

如前所述,我已經在引導中清除了一些空間。我試過apt-get install -f了,這導致了我在上面發布的堆棧跟踪。我還嘗試編輯 dpkg 狀態文件並刪除 initramfs,但同樣沒有成功。我現在已經恢復到原始狀態文件。有誰知道我該如何解決這個問題?

您可以嘗試使用 dpkg 手動安裝單個軟體包(例如 dpkg -i /path/to/package.deb)。.debs 應該在 /var/cache/apt/archives/ 中。從 lib 包開始,尤其是 libssl-dev 和 libpq-dev。

在每個之後,再次嘗試 apt-get -f install 以查看是否已取消它。

引用自:https://serverfault.com/questions/702251