RabbitMQ - 套件具有未滿足的依賴關係

RabbitMQ - 套件具有未滿足的依賴關係

我正在按照以下步驟安裝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 installrabbitmq-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。

相關內容