安装 postgres 会删除 rabbitmq,反之亦然。如何让两者都保留?

安装 postgres 会删除 rabbitmq,反之亦然。如何让两者都保留?

我需要在我的计算机上安装 rabbitmq-server 和 postgresql,apt-get 安装一个会删除另一个。以下是安装命令的输出:

    $ sudo apt-get install postgresql
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
        erlang-asn1 erlang-base erlang-corba erlang-crypto erlang-diameter erlang-edoc erlang-eldap erlang-erl-docgen erlang-eunit erlang-      ic erlang-inets erlang-inviso erlang-mnesia   erlang-nox erlang-odbc erlang-os-mon erlang-parsetools erlang-percept erlang-public-key erlang-runtime-tools erlang-snmp erlang-ssh       erlang-ssl erlang-syntax-tools erlang-tools erlang-webtool erlang-xmerl libkrb5-dev libodbc1 libossp-uuid16 libsctp1 lksctp-tools postgresql-client-9.1
    Use 'apt-get autoremove' to remove them.
    The following extra packages will be installed:
        postgresql-9.2 postgresql-common
    Suggested packages:
        oidentd ident-server locales-all
    The following packages will be REMOVED:
        logrotate rabbitmq-server
    The following NEW packages will be installed:
        postgresql postgresql-9.2 postgresql-common
    0 upgraded, 3 newly installed, 2 to remove and 1 not upgraded.
    Need to get 0 B/3,971 kB of archives.
    After this operation, 13.8 MB of additional disk space will be used.

在安装 postgres 后尝试安装 rabbitmq-server 时:

    $ sudo apt-get install rabbitmq-server
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    The following packages were automatically installed and are no longer required:
    libkrb5-dev libossp-uuid16 postgresql-client-9.1
    Use 'apt-get autoremove' to remove them.
    The following extra packages will be installed:
    logrotate
    Suggested packages:
    mailx
    The following packages will be REMOVED:
      postgresql postgresql-9.1 postgresql-9.2 postgresql-9.2-repmgr postgresql-9.2-slony1-2 postgresql-common postgresql-contrib-9.2 postgresql-plpython-9.2 postgresql-server-dev-9.2
    The following NEW packages will be installed:
    logrotate rabbitmq-server
    0 upgraded, 2 newly installed, 9 to remove and 1 not upgraded.
    Need to get 3,753 kB/3,795 kB of archives.
    After this operation, 37.6 MB disk space will be freed.
    Do you want to continue [Y/n]? 
    Get:1 http://in.archive.ubuntu.com/ubuntu/ raring/main rabbitmq-server all 3.0.2-1 [3,753 kB]
    Fetched 3,524 kB in 19s (177 kB/s)                                                                                                                                                      
    (Reading database ... 337129 files and directories currently installed.)
    Removing postgresql ...
    Removing postgresql-9.1 ...
     * Stopping PostgreSQL 9.1 database server                                                                                                                                        [ OK ] 
    Removing postgresql-plpython-9.2 ...
    Removing postgresql-contrib-9.2 ...
    update-alternatives: warning: forcing reinstallation of alternative /usr/share/postgresql/9.2/man/man1/postmaster.1.gz because link group postmaster.1.gz is broken
    Removing postgresql-9.2-slony1-2 ...
    Removing postgresql-9.2-repmgr ...
    Removing postgresql-9.2 ...
     * Stopping PostgreSQL 9.2 database server                                                                                                                                        [ OK ] 
    Removing postgresql-server-dev-9.2 ...
    Removing postgresql-common ...
    Removing 'diversion of /usr/bin/pg_config to /usr/bin/pg_config.libpq-dev by postgresql-common'
    Processing triggers for ureadahead ...
    ureadahead will be reprofiled on next reboot
    Processing triggers for man-db ...
    Selecting previously unselected package logrotate.
    (Reading database ... 335927 files and directories currently installed.)
    Unpacking logrotate (from .../logrotate_3.8.3-3ubuntu2_amd64.deb) ...
    Selecting previously unselected package rabbitmq-server.
    Unpacking rabbitmq-server (from .../rabbitmq-server_3.0.2-1_all.deb) ...
    Processing triggers for man-db ...
    Processing triggers for ureadahead ...
    Setting up logrotate (3.8.3-3ubuntu2) ...
    Setting up rabbitmq-server (3.0.2-1) ...
    * Starting message broker rabbitmq-server

我的 django 应用程序应该使用 postgres 作为数据库,使用 rabbitmq 作为 celery ...而且他们都表现得像嫉妒的女朋友一样。

更新:apt-cache 策略

 # apt-cache policy
 Package files:
 100 /var/lib/dpkg/status
      release a=now
 500 http://apt.postgresql.org/pub/repos/apt/ precise-pgdg/main amd64 Packages
      release o=apt.postgresql.org,a=precise-pgdg,n=precise-pgdg,l=PostgreSQL for Debian/Ubuntu repository,c=main
      origin apt.postgresql.org
 500 http://security.ubuntu.com/ubuntu/ raring-security/main Translation-en
 500 http://security.ubuntu.com/ubuntu/ raring-security/main amd64 Packages
      release v=13.04,o=Ubuntu,a=raring-security,n=raring,l=Ubuntu,c=main
      origin security.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ raring-updates/universe Translation-en
 500 http://archive.ubuntu.com/ubuntu/ raring-updates/main Translation-en
 500 http://archive.ubuntu.com/ubuntu/ raring-updates/universe amd64 Packages
      release v=13.04,o=Ubuntu,a=raring-updates,n=raring,l=Ubuntu,c=universe
      origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ raring-updates/main amd64 Packages
      release v=13.04,o=Ubuntu,a=raring-updates,n=raring,l=Ubuntu,c=main
      origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ raring/universe Translation-en
 500 http://archive.ubuntu.com/ubuntu/ raring/main Translation-en
 500 http://archive.ubuntu.com/ubuntu/ raring/universe amd64 Packages
      release v=13.04,o=Ubuntu,a=raring,n=raring,l=Ubuntu,c=universe
      origin archive.ubuntu.com
 500 http://archive.ubuntu.com/ubuntu/ raring/main amd64 Packages
      release v=13.04,o=Ubuntu,a=raring,n=raring,l=Ubuntu,c=main
      origin archive.ubuntu.com
 Pinned packages:

apt-cache 显示 rabbitmq 服务器:

 # apt-cache show rabbitmq-server
 Package: rabbitmq-server
 Priority: extra
 Section: net
 Installed-Size: 4356
 Maintainer: Ubuntu Developers <[email protected]>
 Original-Maintainer: RabbitMQ Team <[email protected]>
 Architecture: all
 Version: 3.0.2-1
 Depends: erlang-nox (>= 1:12.b.3), adduser, logrotate
 Filename: pool/main/r/rabbitmq-server/rabbitmq-server_3.0.2-1_all.deb
 Size: 3753308
 MD5sum: f89d5b663d67af38ea8f7948fc9ab61a
 SHA1: 30b7b865c42cd279e1194839d69fd522dc0ae12b
 SHA256: 981da016a32255f051fe43d5c6c8ed406b4f22cc8ac7c9dad01690bf42ea1959
 Description-en: AMQP server written in Erlang
 RabbitMQ is an implementation of AMQP, the emerging standard for high
 performance enterprise messaging. The RabbitMQ server is a robust and
 scalable implementation of an AMQP broker.
 Homepage: http://www.rabbitmq.com/
 Description-md5: 78e91bfb996ee4ae5d16c93298f5f6e8
 Bugs: https://bugs.launchpad.net/ubuntu/+filebug
 Origin: Ubuntu
 Supported: 9m

答案1

问题是 apt.postgresql.org 的 precise-pgdg postgresql 包与 raring 兼容,但 logrotate 除外。Logrotate 3.8 更改了其配置文件,postgresql-9.2 将坚持要求您的 logrotate 版本相对于您的 postgresql 版本没有错误。解决此问题的一种方法是在安装 postgresql-9.2 时删除 logrotate。

一个可能的解决方法是安装 precise 的 logrotate(3.8 之前的版本)。这应该可以让 postgresql-9.2 和 rabbitmq 都满意。

我们正在考虑为 apt.postgresql.org 寻找一种解决方法,但到目前为止,还没有人想出一个不需要太多魔法的解决方案。(我们不会支持 apt.postgresql.org 上的 raring 作为单独的发行版,因为它不是 LTS 版本。)

高血压

相关内容