3

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.
  • What distribution do you have? And version? Possible that the library is not supported on your system. Otherwise you could try installing it from source. – xR34P3Rx Oct 29 '17 at 16:35
  • As I wrote, Xubuntu 17.10. – user258532 Oct 29 '17 at 18:01
  • Alternatively, you can use the TOR Bundle, no installation required (but this isn't an answer to your question, obviously, just a suggestion). – user692175 Nov 1 '17 at 7:24
2

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:

sudo apt install 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:

sudo apt install libevent-dev
sudo apt install libevent1-dev
sudo apt install libevent-2.1-6

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 the libevent-2.1.6, Xubuntu 17.10 already comes with this version of libevent.

sudo apt install libevent-dev

sudo apt install libevent1-dev # This library is required for the libevent-1.4-2, but Xubuntu 17.10 already comes with libevent-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.

sudo apt install libevent1-dev

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:

sudo apt install libevent-2.1-6

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.

sudo apt install libevent*

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.

sudo apt autoremove

Hope it helps, good luck!

  • Thanks for your comment @Zanna, I already extended the answer explaining the conflict issue in text and with screenshots proving how the issue was caused and how to solve it. =) – galoget Jan 8 '18 at 12:25
  • 1
    upvoted, although I don't recommend showing screenshots of the terminal, unless you want to show something that cannot be shown by copying and pasting the text and formatting as code (eg text formatting features) – Zanna Jan 8 '18 at 12:51
  • Ok, I'll consider it for next answers, thanks for the advice. – galoget Jan 8 '18 at 12:53
0

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/source.list, after corrected it, everything works fine. You may want to double check that.

for 17.10,

deb http://deb.torproject.org/torproject.org artful main

deb-src http://deb.torproject.org/torproject.org artful main

0

terminal screenshot

You should be able to use any of the listed mirrors by adding a line to your /etc/apt/sources.list like this:

deb http://ftp.de.debian.org/debian stretch main
  • welcome to askubuntu. please don't post screenshots of the terminal instead copy the text and past it into your post. – Jeff Mar 24 at 17:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.