Ubuntu – How to run/use popcorn-time

software installation

I got popcorn time installed using this link:

Install Popcorn Time from source files

But I have no clue how to use or run Popcorn time. Do I open my torrent client and download a movie and then it gets going? or do I have to open it? If I have to open it, how do I do that, I opened the dash and tried clicking on it but nothing happened.
Please help me!! 😀

Best Answer

TL;DR: This problem is now solved by upgrading Popcorn Time to Beta 0.3.0 or higher. It's not a bug that's been fixed, per se, but instead an incompatibility between some versions of Popcorn Time and some versions of Ubuntu.

Do I open my torrent client and download a movie and then it gets going?

If you know how to use a bittorrent client, and you have a .torrent metafile or magnet link for the torrent you want to download (for a movie or otherwise), you don't need Popcorn Time.

Popcorn Time automates this process for some torrents (though probably not as well as you can do it yourself, with torrents you have yourself selected and a bittorrent client you've possibly even configured to work as you like).

Learning how to use a bittorrent client is actually pretty easy, and searching for torrents is not all that difficult either. (Some torrent programs, like qBittorrent, even integrate search functionality.) So it's possible even many people who think they need Popcorn Time actually don't. I'm not saying this to insult the software in any way, but instead because I wish to encourage people to familiarize themselves with bittorrent, which is a widely implemented technology useful for numerous purposes, including the reliable and fast distribution of free OSes like Ubuntu.

But if you do want to use Popcorn Time, it does sound like you are having the problem addressed in André Marinho's answer: in Popcorn Time's binary distribution, its executable linked to the shared library libudev0, but newer versions of Ubuntu than 12.04 use libudev1. Though I believe this problem is fixed in more recent versions of Popcorn Time; see below.

Assuming the incompatibility is entirely superficial—i.e., that the executable links to the wrong (for Ubuntu) library but doesn't rely on any of the differences between libudev0 and libudev1—the solution of editing the executable with a hex editor so it declares linkage with libudev1 instead should work.

Here are another couple solutions.

Make sure you're running the latest version.

While development has stopped on the original version of Popcorn Time, it's currently being developed by others. 32- and 64-bit Linux versions are provided now and likely work out of the box on Ubuntu.

So make sure you're running the latest version, unless you have a specific need for an earlier version. That might, by itself, fix this problem.

(I did try this, on a 64-bit Utopic system. Both the 64-bit and 32-bit versions of Popcorn Time Beta 3.2 were able to run; neither had this problem. I only tried starting the program; I didn't test downloading.)

Just make a symlink to the needed library.

I've been able to reproduce the problem on a new version of Ubuntu by using an old version of Popcorn Time (Beta 0.29). I then tested this and the following solution, which worked.

If you're an administrator on your Ubuntu system, then you can run commands as root with sudo. So you can create a symbolic link to libudev1 and call the link libudev0. Then when Popcorn Time tries to use libudev0, it will automatically and seamlessly use libudev.

sudo ln -s /lib/$(arch)-linux-gnu/libudev.so.1 /lib/$(arch)-linux-gnu/libudev.so.0

You might have noticed something very similar in the script in MrVaykadji's answer to Install Popcorn Time from source files. This is actually the exact opposite—there, the script makes a link to libudev.so.0 called libudev.so.1 because old versions of Ubuntu (specifically, 12.04) have libudev.so.0 and new versions of Popcorn Time need libudev.so.1. In contrast, the solution I'm giving here is for old versions of Popcorn Time that need libudev.so.0 running on new versions of Ubuntu that have libudev.so.1.

The symlink solution, if you're not an administrator.

If you cannot run commands as root with sudo on the Ubuntu system you're using (because you're not an administrator), or if you don't want to go messing with those parts of your system, you can make the symbolic link elsewhere and run Popcorn Time in a special way to make it use the symlink even though it's not in a libs directory.

Suppose you have the Popcorn Time program folder in your home folder, so it's ~/Popcorn-Time. Run:

cd ~/Popcorn-Time
ln -s /lib/$(arch)-linux-gnu/libudev.so.1 libudev.so.0
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:. ./Popcorn-Time

The ln -s command puts a symlink called libudev.so.0 (to the system's libudev.so.1) in the Popcorn-Time folder. The second command, runs Popcorn-Time with the current directory added to the LD_LIBRARY_PATH variable.

Since LD_LIBRARY_PATH is not commonly used and probably doesn't contain anything necessary for Popcorn Time to run (probably not anything at all, actually), this command will probably also work:

LD_LIBRARY_PATH=. ./Popcorn-Time

You should try that too, since if it doesn't work, it will make the next step a bit more complicated.

Making a Launcher

Running Popcorn Time from the terminal like that (typing LD_LIBRARY_PATH=...) is mainly for testing to make sure it's set up correct. It would be quite inconvenient to always have to do that.

So you should make a launcher to run Popcorn Time. (Depending on what desktop environment you use, you can probably do this by right-clicking on your desktop and clicking Create Launcher...)

The launcher should be made to run this command:

env LD_LIBRARY_PATH=/home/username/Popcorn-Time /home/ek/Popcorn-Time/Popcorn-Time

(I've used env since VARIABLE=value command syntax is not generally supported in application launcher icons. ~ and environment variable expansion is also not usually supported, which is why you have to give it the full explicit name of where to find Popcorn Time and your library symlink.)

Replace username with your actual username. (You'll have to edit both instances of /home/username/Popcorn-Time further if the Popcorn Time program folder is not right in your home folder.)

Alternative: Making a Launcher to a Shell Script

If the shorter command LD_LIBRARY_PATH=. ./Popcorn-Time didn't work, you'll probably need to write a shell script to assign LD_LIBRARY_PATH the correct value, incorporating its previous contents, while launching Popcorn Time.

I'd suggest creating the shell script in the Popcorn Time program folder, alongside the Popcorn-Time executable and the libudev.so.0 symlink.

cd ~/Popcorn-Time      # if you're not already there
gedit popcorn-time.sh  # if you want you can use a different text editor than gedit

Put this in the text file (this is your shell script):

#!/bin/sh
DIR=~/Popcorn-Time
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$DIR $DIR/Popcorn-Time

If the Popcorn Time program folder is something other than ~/Popcorn-Time, you can conveniently change it in just one place in the script: on the DIR= line.

When you're done, save the file, quit the text editor, and make the shell script executable:

chmod +x popcorn-time.sh

Then when you make the launcher, the command it should run is simply:

/home/username/Popcorn-Time/popcorn-time.sh

Replace /home/username/Popcorn-Time with the actual path to the Popcorn Time program folder. So if it's ~/Popcorn-Time, just replace username with your actual username.

Related Question