我正在按照以下步骤安装 rabbitmqUbuntu 16
echo "deb http://www.rabbitmq.com/debian/ testing main" | sudo tee /etc/apt/sources.list.d/rabbitmq.list > /dev/null
wget https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
sudo apt-key add rabbitmq-signing-key-public.asc
sudo apt-get update
sudo apt-get install rabbitmq-server -y
sudo service rabbitmq-server start
sudo rabbitmq-plugins enable rabbitmq_management
sudo service rabbitmq-server restart
执行 >> sudo apt-get install rabbitmq-server -yi 后出现以下错误
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies:
rabbitmq-server : Depends: erlang-base (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
erlang-base-hipe (>= 1:21.3) but it is not going to be installed or
esl-erlang (>= 1:21.3) but it is not installable
Depends: erlang-crypto (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
esl-erlang (>= 1:21.3) but it is not installable
Depends: erlang-eldap (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
esl-erlang (>= 1:21.3) but it is not installable
Depends: erlang-inets (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
esl-erlang (>= 1:21.3) but it is not installable
Depends: erlang-mnesia (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
esl-erlang (>= 1:21.3) but it is not installable
Depends: erlang-os-mon (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
esl-erlang (>= 1:21.3) but it is not installable
Depends: erlang-parsetools (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
esl-erlang (>= 1:21.3) but it is not installable
Depends: erlang-public-key (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
esl-erlang (>= 1:21.3) but it is not installable
Depends: erlang-runtime-tools (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
esl-erlang (>= 1:21.3) but it is not installable
Depends: erlang-ssl (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
esl-erlang (>= 1:21.3) but it is not installable
Depends: erlang-syntax-tools (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
esl-erlang (>= 1:21.3) but it is not installable
Depends: erlang-tools (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
esl-erlang (>= 1:21.3) but it is not installable
Depends: erlang-xmerl (>= 1:21.3) but 1:18.3-dfsg-1ubuntu3.1 is to be installed or
esl-erlang (>= 1:21.3) but it is n
答案1
解决问题的第一步是恢复命令的效果。
让我们从您的第一个命令开始。
echo "deb http://www.rabbitmq.com/debian/ testing main" | sudo tee /etc/apt/sources.list.d/rabbitmq.list > /dev/null
这将创建一个文件/etc/apt/sources.list.d/rabbitmq.list
。因此,您要删除此文件。要删除该文件,请运行以下命令。
sudo rm /etc/apt/sources.list.d/rabbitmq.list
您的下一个命令是下载文件。
wget https://www.rabbitmq.com/rabbitmq-signing-key-public.asc
如果您知道文件下载的位置,则可以删除该文件。它应该下载到执行命令的目录中。如果您刚刚打开终端,则很可能它在您的主目录中。
下一个命令是使用 apt-key 添加 gpg 密钥。因此,您必须删除 gpg 密钥。请参阅此问题的答案如何删除使用 apt-key add - 添加的 gpg 密钥?。
现在您已经删除了 gpg 密钥。您应该运行sudo apt update
现在,您可以按照官方说明安装 RabbitMQ指示。官方说明不是组织得最好的。不过,我已尝试提炼出适用于 ubuntu 16.04 的命令。
第一步是安装 Erlang。运行以下命令。这里我只是从关联。
curl -fsSL https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc | sudo apt-key add -
sudo apt-get install apt-transport-https
echo "deb http://dl.bintray.com/rabbitmq-erlang/debian xenial erlang-22.x" > | sudo tee /etc/apt/sources.list.d/bintray.erlang.list > /dev/null
sudo apt-get update -y
sudo apt-get install -y erlang-base \
erlang-asn1 erlang-crypto erlang-eldap erlang-ftp erlang-inets \
erlang-mnesia erlang-os-mon erlang-parsetools erlang-public-key \
erlang-runtime-tools erlang-snmp erlang-ssl \
erlang-syntax-tools erlang-tftp erlang-tools erlang-xmerl
现在你应该已经安装好了 Erlang。现在你可以安装 RabbitMQ。你应该运行以下命令命令。
sudo apt-get install curl gnupg -y
curl -fsSL https://github.com/rabbitmq/signing-keys/releases/download/2.0/rabbitmq-release-signing-key.asc | sudo apt-key add -
echo "deb https://dl.bintray.com/rabbitmq/debian xenial main" | sudo tee /etc/apt/sources.list.d/bintray.rabbitmq.list
sudo apt-get update -y
sudo apt-get install -y rabbitmq-server
您现在应该已经安装了 RabbitMQ。