I have a server with Ubuntu Linux 16.04. I installed tor like written in https://www.torproject.org/docs/debian.html.en#ubuntu (chose Xenial repos). I wrote what I believe to be the correct rows in the Tor config file, but I executed:

sudo service tor restart

(also tried start argument).
As well as

/etc/init.d/tor start
But in the end I received this error:
/usr/bin/pkttyagent: error while loading shared libraries: libsystemd-login.so.0: cannot open shared object file: No such file or directory
I have no libsystemd-login.so.0 file in system. Packages.ubuntu.com says there is no package that provides that file in Xenial, only in Trusty.

How can I run a tor relay on my Xenial-based system?

  • You want to use the service command, not /etc/init.d/tor. What does sudo journalctl -u tor@default --no-pager output?
    – cacahuatl
    Oct 9, 2017 at 4:35
  • @canonizingironize his problem was the Tor binary package built for a previous version of Ubuntu: the library tor complains about is a systemd-integration part and it's package was removed in later Ubuntu releases. It's sad, but the repository maintainers do not use either a proper reposiroty setup, or a static build. That's where such a "glitches" are popping out from. The Ubuntu problem is really annoying - with the packages just removed at will, so the "backporting" trick I've mentioned in my answer is quite a common medicine for this kind of problems
    – Alexey Vesnin
    Oct 9, 2017 at 21:00
  • So it's an issue with package dependencies in their ubuntu setup and your proposed solution did not work.
    – cacahuatl
    Oct 10, 2017 at 0:50

1 Answer 1


Add the apt sources from Xenial and try this:

sudo apt-get update
sudo apt-get upgrade
sudo apt-get --reinstall install libsystemd-login0 libsystemd-login-dev
sudo ldconfig
  • No packages libsystemd-login0 and libsystemd-login-dev. Oct 7, 2017 at 21:47
  • у тебя старый пакет тора - из репозитария. поэтому - если УЖ ОЧЕНЬ ХОЧЕТСЯ использовать именно его, то добавь старые пакеты и поставь их. IMHO - just IMHO - tor правильнее собирать из исходников
    – Alexey Vesnin
    Oct 7, 2017 at 21:49

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .