When I try to install Tor, APT complains about 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
I use Xubuntu 17.10 with the 4.13.8 kernel (4.13.0 prevents my computer from properly shutting down.) I have added these lines to my sources.list
deb http://deb.torproject.org/torproject.org artful main
deb http://deb.torproject.org/torproject.org zesty main
and I've tried apt update
, apt dist-upgrade
and apt autoremove
, without success.
How can I install the required version of libevent
?
Update:
When I try sudo apt install libevent*
, I get the following error:
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.
About your question, here is how I fixed the problem, I extended the answer because in the comments some users ask for that:
First, your error is a problem caused by a previous installation (for another package or update), the
tor
package doesn't depend on that library, I have Xubuntu 17.10 a FRESH INSTALL, and here is the output of installing tor:As you see, there is no requirement for
libevent*
, but you have to fix that error before installing tor, I suggest you to try executing the following commands:Here there is a screenshot of the output of every command (Installing the dependencies in this way produces NO ERRORS):
sudo apt install libevent-dev
# This library is required for thelibevent-2.1.6
, Xubuntu 17.10 already comes with this version oflibevent
.sudo apt install libevent1-dev
# This library is required for thelibevent-1.4-2
, but Xubuntu 17.10 already comes withlibevent-2.1.6
so that is the cause of the conflict. I suggest you to install it, just if you really need it, otherwise, use the latest version.And the last command will be
sudo apt install libevent-2.1-6
, this is just to prove that Xubuntu 17.10 comes with this library:These commands will install dependencies one by one in a separate way, avoiding the conflict, because if you use
sudo apt install libevent*
, that command is the cause of the error message, see the image below. You're trying to install two versions of the same library at the same time.After executing those commands, I didn't get any errors and the dependencies are now correctly installed.
Finally, if you want, you can execute
sudo apt autoremove
, to delete the unnecesary packages.Hope it helps, good luck!
I encountered the same issue installing tor on Ubuntu 17.10. It turned out to be the problem with apt repository version.
I had the repo for 16.04 (Xenial) instead of 17.10 (Artful) in my
/etc/apt/sources.list
. After corrected it, everything works fine. You may want to double check that.For 17.10:
You should be able to use any of the listed mirrors by adding a line to your
/etc/apt/sources.list
like this: