26

The Debian/Ubuntu packages from deb.torproject.org[docs] do not work on the Raspberry Pi when running Raspbian:

    $ tor --version
    Illegal instruction

Why, and how can I still run Tor versions newer than what ships with Raspbian?

6 Answers 6

23

The issue

The packages we build for deb.tpo are compiled for various Debian and Ubuntu architectures. These currently are amd64, i386 (x86-64 and x86), and two arm ports: armel and armhf.

Arm CPUs come in different versions, and newer versions generally have more features. The arm ports of Debian differ in what kind of CPU they need as a minimum. In particular, the armhf port needs at least ARMv7.

The arm CPU shipped in the Raspberry Pi is an ARMv6 CPU. As such, packages built for Debian's armhf port do not, in general, work on Raspberry Pi systems. Packages compiled for Debian's older arm port, armel, would work on the Raspberry Pi.

Unfortunately however, Raspbian, a system based on Debian but built for the Raspberry Pi, still decided to call their architecture armhf, even if they can't run Debian armhf binaries. This means two things if you run Raspbian:

  • You can't install the packages we built for armel and that would work on your hardware, at least not easily[1].
  • The packages we built for Debian's armhf will install cleanly -- after all, they say they are for the same architecture as the host -- but then they will not work.

Solution

If you want to run newer Tor versions than are available from the Raspbian folks, you will have to build them yourself.

You can either build it from the source tarball like a lot of other Unix/Linux software and install it locally.

The better option might be to build your own binary Debian packages using the source packages that we put up on deb.tpo. This means you will end up with nice Debian packages that you can install using dpkg and that integrate well in your current system.

To build such packages, follow the documentation on Tor's page about Debian packages. It's a few easy steps, good luck!


[1]: While the binaries built for armel would work on your hardware, they would need all the libraries they depend on built for armel as well. That is, you probably would need an all-armel system or a chroot. Hence "not easily".

3

This info seems obsolete. On the 'Pi:

sudo apt-get install tor

...now results in a working install. (Of course, you must appropriately edit torrc and then restart the service.)

2
  • 5
    OP is trying to run a more recent version than in the repos.
    – cubecubed
    Jun 10, 2014 at 23:43
  • 1
    This will "work" in the sense that will install an outdated version of Tor from the standard Debian repos, which is why the Tor Project website instructions recommend using their repos instead.
    – huertanix
    May 6, 2017 at 19:02
1

For those looking for binary downloads, see https://github.com/gordon-morehouse/cipollini/tree/master/raspbian_packages with the appropriate caveat emptor about installing binary software from a dude you don't know (me) on the Internet.

I don't have deterministic builds going for Raspbian packages yet, so these are hand-built straight from the source packages using the method described on the Tor Project web site, then I sign them with my GPG key. I'm fairly active on the mailing lists, so, that's what you have to work on for trust. :)

Otherwise, yep, you're gonna be compiling 'em yourself - takes about 40 min on my 900MHz Pis.

1

I found a complete tutorial for Raspbian with prebuilt binaries for the latest version. Also, full instructions for building from source are provided. You can catch them here: http://unsuspectingbit.com/tutorial-private-anonymizing-proxy-raspberry-pi-tor-based/

[on Saturday11April2015 Seems to be a dead link: If anyone has a more current link or if the new owners of the domain haven't erased it and would put it back up.... Then there is the trust issue to deal with. OOPS! --Glenn]

1
  • 1
    Download prebuilt tor binaries (including mine, which I haven't been keeping up to date) at your own risk. Dec 18, 2014 at 21:54
1

Although the answer has been accepted, I have some sort of update:

While everything "weasel" said is true, we now have the Raspberry 2, that works perfectly as it features an ARMv7 CPU.

In other words: Go ahead and add the Debian armhf repo of the Tor project and it will result in an up-to-date setup that's working like a charm (as long as you use a Raspberry 2 model)

-creo

1
  • Confirmed, this is the easiest way to install Tor on a Raspberry Pi 2. Thanks for the info! Mar 25, 2016 at 0:06
0

On the latest Raspbian (stretch), follow the instructions here https://www.torproject.org/docs/debian.html.en, ensuring you select "stretch" from the drop down menu, they say how to set up your apt-get repos to use the tor repo, ensuring that the get the latest and greatest version (Raspbian repos will work fine, but they might not be the latest version).

There is a message at the top of the page warning about Rasbian incompatability, this can be ignored and as it is talking about the Raspberry Pi 1 with its older ARM V6 processor, not the newer Raspberry Pi 2/3 with its newer, ARM V7/8 processor.

You must log in to answer this question.

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