in ,

How to install Bazarr in OpenMediaVault (OMV) 2.x

How to install Bazarr in OMV 2.x

When you try to install Bazarr in OpenMediaVault, you’ll run into a few obstacles. In this post I’ll show you what I did to overcome these obstacles and show you the proper way to install and run Bazarr alongside Sonarr and Radarr.

Recently I was looking for a neat way to manage subtitles on my OpenMediaVault NAS to increase the Wife Approval Factor (WAF). So I ran into Bazarr, a companion for Sonarr and Radarr, which organizes all your downloaded subtitles for all your TV Shows and Movies and allows you to easily download additional subs using Subliminal.

Because there is no package available for OMV, I had to compile Bazarr from source.

Prerequisites

Make sure Git is installed. This can easily be done by running apt-get install git-core. Besides Git we need a few other packages:

# Prerequisites for Python 2.7.x
apt-get update
apt-get install build-essential checkinstall
apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev

Compile Python from Source

Because OpenMediaVault ships with Python 2.7.3, we need to update to a later version (Bazarr requires at least 2.7.13.) However, the repository hasn’t been updated in a while, so pip install python --upgrade will tell you you’re already running the latest version. So we need to compile Python from source:

# Download and extract Python 2.7.13
cd /usr/src
curl -O https://www.python.org/ftp/python/2.7.13/Python-2.7.13.tgz
tar xvfz Python-2.7.13.tgz

There’s a downside to this; compiling Python from source means no package management, which means that sqlite3 (which we need) isn’t installed along with it. So we need to create a little workaround and ‘help’ the installer to find our the sqlite3 package we installed ourselves a few moments ago. Run which sqlite3 in your terminal and your output will probably be /usr/bin/sqlite3. We’re going to need this data:

# Edit setup.py before compiling and add the output of `which sqlite3` to an array called sqlite_inc_paths
nano /usr/src/Python-2.7.13/setup.py

Inside the text editor, search (CTRL + W) for an array called sqlite_inc_paths this is where you should add the path to your sqlite3 installation. Now the array should look something like this:

sqlite_inc_paths = [ '/usr/include',
                     	'/usr/include/sqlite',
                     	'/usr/include/sqlite3',
                     	'/usr/local/include',
                     	'/usr/local/include/sqlite',
                     	'/usr/local/include/sqlite3',
                   	'usr/bin/sqlite3',
                 ]

Write your changes to the file (CTRL + O) and return to the terminal. Now it’s time to compile Python from source.

To avoid conflicting situations, where OMV’s core (or another application) might break, we’re creating an alternate install of Python 2.7.13 which can run alongside the version of Python OMV is shipped with.

# Compile Python
cd Python-2.7.13
sudo ./configure --enable-optimizations
sudo make altinstall
# Check Version
python2.7 -v

After this we can check the python version with python2.7 -v and it will output 2.7.13. If you run python -v you’ll notice that it still outputs 2.7.3.

Install Bazarr from Source in OMV

Now the hardest part is done, it’s time to finally install Bazarr. You can run it from anywhere you want, but since both Radarr and Sonarr are installed in the /opt/ directory, I created a folder there for Bazarr as well: mkdir /opt/Bazarr. Then I cloned the Git repository: git clone https://github.com/morpheus65535/bazarr.git /opt/Bazarr

Schedule Bazarr to launch at reboot
Schedule Bazarr to launch at reboot

Now you can run Bazarr by executing python2.7 /opt/Bazarr/bazarr.py. But if you want to have it launch at startup, make sure you add it to your Scheduled Jobs within the OMV admin screen.

That’s it. You’ve succesfully installed Bazarr to easily manage your subtitles downloaded to your OMV NAS. The app’s Wiki has plenty of other awesome stuff to read through, like how to setup a Reverse Proxy for Bazarr. So I’ll stop talking now and leave you to it. Enjoy!

Buy me a beer?

Do you appreciate my work and support? Please consider supporting me by donating, so I can continue to develop and write useful solutions for you.

Choose amount

Personal Message

Thank you! 🙂

Written by Daan van den Bergh

Magento 2 Back-end Developer with a passion for trainlifting, airplane-gliding, hunting trees and creating fake hobbies.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.