安装/卸载不起作用

安装/卸载不起作用

执行 sudo apt-get install 或类似命令时,我收到此消息:

You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
 postgresql-client-9.1 : Breaks: postgresql-9.1 (< 9.1.11-1.pgdg12.4+1) but 9.1.10-1.pgdg12.4+1 is to be installed
 postgresql-contrib-9.1 : Depends: postgresql-9.1 (= 9.1.11-1.pgdg12.4+1) but 9.1.10-1.pgdg12.4+1 is to be installed
 synaptic : Depends: libvte9 (>= 1:0.24.0) but it is not going to be installed
            Recommends: rarian-compat but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Ubuntu 软件中心和更新管理器也不起作用 - 软件中心一直尝试修复,但从未成功,apt-get -f install 没有帮助(修复因这些软件包而取消)。所有错误消息都与这些软件包有关。

我能做些什么来让它工作吗?

编辑:'apt-get install -f' 后的输出:

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:
  libkrb5-dev
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  postgresql-9.1
Suggested packages:
  oidentd ident-server locales-all
The following packages will be upgraded:
  postgresql-9.1
1 upgraded, 0 newly installed, 0 to remove and 256 not upgraded.
4 not fully installed or removed.
Need to get 0 B/3,629 kB of archives.
After this operation, 10.2 kB of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: dependency problems prevent configuration of postgresql-9.1:
 postgresql-client-9.1 (9.1.11-1.pgdg12.4+1) breaks postgresql-9.1 (<< 9.1.11-1.pgdg12.4+1) and is installed.
  Version of postgresql-9.1 to be configured is 9.1.10-1.pgdg12.4+1.
dpkg: error processing postgresql-9.1 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-9.1-postgis-2.0:
 postgresql-9.1-postgis-2.0 depends on postgresql-9.1; however:
  Package postgresql-9.1 is not configured yet.
dpkg: error processing postgresql-9.1-postgis-2.0 (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-9.1-pgrouting:
 postgresql-9.1-pgrouting depends on postgresql-9.1-postgis-2.0 | postgresql-9.1-postgis; however:
  Package postgresql-9.1-postgis-2.0 is not configured yet.
  Package postgresql-9.1-postgis is not installed.
dpkg: error processing postgresql-9.1-pgrouting (--configure):
 dependency probNo 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.
                                                                    No apport report written because the error message indicates its a followup error from a previous failure.
              No apport report written because MaxReports is reached already
                                                                            lems - leaving unconfigured
dpkg: dependency problems prevent configuration of postgresql-contrib-9.1:
 postgresql-contrib-9.1 depends on postgresql-9.1 (= 9.1.11-1.pgdg12.4+1); however:
  Version of postgresql-9.1 on system is 9.1.10-1.pgdg12.4+1.
dpkg: error processing postgresql-contrib-9.1 (--configure):
 dependency problems - leaving unconfigured
Errors were encountered while processing:
 postgresql-9.1
 postgresql-9.1-postgis-2.0
 postgresql-9.1-pgrouting
 postgresql-contrib-9.1
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

尝试通过运行以下命令强制删除软件包,

sudo dpkg --purge --force-all --force-remove-reinstreq postgresql-9.1 postgresql-9.1-postgis-2.0 postgresql-9.1-pgrouting postgresql-contrib-9.1

然后运行,

sudo apt-get -f install

在这种情况下,任何其他方法都dpkg --purge --force-all --force-remove-reinstreq不起作用。

相关内容