当我试图安装Tor时,APT抱怨libevent:
$ sudo apt install tor
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:
tor : Depends: libevent-2.1-6 (>= 2.0.10-stable) but it is not installable我使用Xubuntu17.10和4.13.8内核(4.13.0阻止我的计算机正常关闭)。我已将这些行添加到我的sources.list中
deb http://deb.torproject.org/torproject.org artful main
deb http://deb.torproject.org/torproject.org zesty main我试过apt update,apt dist-upgrade和apt autoremove,但都没有成功。
如何安装所需的libevent版本?
当我尝试sudo apt install libevent*时,会得到以下错误:
libevent-2.1-6 is already the newest version (2.1.8-stable-4).
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:
libevent1-dev : Conflicts: libevent-dev but 2.1.8-stable-4 is to be installed
E: Unable to correct problems, you have held broken packages.发布于 2018-03-07 14:54:27
我在Ubuntu17.10上遇到了同样的问题:安装tor。原来是apt存储库版本的问题所在。
在我的/etc/apt/sources.list中,我的回购是16.04 (Xenial)而不是17.10 (巧妙的)。修正后,一切都很好。你可能想再查一遍。
17.10:
deb http://deb.torproject.org/torproject.org artful main
deb-src http://deb.torproject.org/torproject.org artful main发布于 2018-01-07 05:28:22
关于你的问题,以下是我是如何解决问题的,我扩展了答案,因为在一些用户的评论中要求:
首先,您的错误是由以前的安装(对于另一个包或更新)引起的问题,tor包不依赖于这个库,我有一个新的安装Xubuntu17.10,下面是安装tor的输出:

正如您所看到的,不需要libevent*,但是您必须在安装tor之前修复该错误,我建议您尝试执行以下命令:
sudo apt install libevent-dev
sudo apt install libevent1-dev
sudo apt install libevent-2.1-6这里有每个命令输出的屏幕截图(以这种方式安装依赖项不会产生错误):
sudo apt install libevent-dev #这个库是libevent-2.1.6所必需的,Xubuntu17.10已经提供了这个版本的libevent。

sudo apt install libevent1-dev #这个库是libevent-1.4-2所必需的,但是Xubuntu17.10已经提供了libevent-2.1.6,这就是冲突的原因。我建议你安装它,如果你真的需要它,否则,使用最新的版本。

最后一个命令是sudo apt install libevent-2.1-6,这只是为了证明Xubuntu17.10附带了这个库:

这些命令将以单独的方式逐一安装依赖项,避免冲突,因为如果使用sudo apt install libevent*,则该命令是错误消息的原因,请参见下面的图像。您正在尝试同时安装同一个库的两个版本。

在执行这些命令之后,我没有收到任何错误,现在正确安装了依赖项。
最后,如果需要,可以执行sudo apt autoremove来删除不必要的包。

希望能帮上忙,祝你好运!
发布于 2019-03-24 16:57:48

您应该能够通过向您的/etc/apt/sources.list添加一行来使用所列的镜像,如下所示:
deb http://ftp.de.debian.org/debian stretch mainhttps://askubuntu.com/questions/970618
复制相似问题