# Ubuntu script to install OpenPHT

**URL:** <https://forums.plex.tv/t/ubuntu-script-to-install-openpht/148021>\
**Category:** Apps & Creations\
**Created:** [June 14, 2016, 9:53am UTC](https://forums.plex.tv/t/ubuntu-script-to-install-openpht/148021 "2016-06-14T09:53:45Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![blindy](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@blindy](https://forums.plex.tv/u/blindy)\
**Post date:** [June 14, 2016, 9:53am UTC](https://forums.plex.tv/t/ubuntu-script-to-install-openpht/148021/1 "2016-06-14T09:53:45Z")

</div>

**EDIT: Official builds are now available, you can use this if you want to build it yourself for specific [commits/bug fixes](https://github.com/RasPlex/OpenPHT/commits "commits/bug fixes") while you wait for official builds. This build will not interfere with the official builds, you can run both along side each other.**

Had to update a few systems so decided to write a script, while i was at it, tried to make it future proof.  
It will generate a loader script that you must use to run OpenPHT.

It should not conflict with existing ffmpeg installs or plex installs but see options.  
Updated a few systems on 16.04 and 14.04 already.

Use at own risk, no support provided.

To use, in terminal:

```
wget https://anythingtech.com.au/public/openpht-install
chmod +x openpht-install
./openpht-install

```

Default options are:

```
WORKINGBASEDIR=~/Downloads/OpenPHT
FFMPEGCUSTINSTDIR=/opt/ffmpeg-openpht
OPENPHTINSTALLDIR=/opt/openpht
LOADERSCRIPTDIR=~

```

Based on vdimitrov’s guide [https://forums.plex.tv/discussion/comment/1196558/#Comment\_1196558](https://forums.plex.tv/discussion/comment/1196558/#Comment_1196558)

Any weird behaviour is probably caused by the old plex home theater for linux.

in terminal run

```
mv .plexht/ .plexht.bak/
mv .kodi/ .kodi.bak/

```

Reconfigure plex. Tearing is probably caused by the wrong Dirty region setting, try 3 (default 1). [http://kodi.wiki/view/HOW-TO:Modify\_dirty\_regions](http://kodi.wiki/view/HOW-TO:Modify_dirty_regions)

---

<div class="post-metadata">

**Author:** ![vdimitrov](https://avatars.discourse-cdn.com/v4/letter/v/e95f7d/32.png) [@vdimitrov](https://forums.plex.tv/u/vdimitrov)\
**Post date:** [June 16, 2016, 1:23pm UTC](https://forums.plex.tv/t/ubuntu-script-to-install-openpht/148021/2 "2016-06-16T13:23:46Z")

</div>

Tested on Ubuntu 14.04. Nicely done. Just two small issues:

1. During sudo apt-get install  
Package libcurl-dev is a virtual package provided by:  
libcurl4-openssl-dev 7.35.0-1ubuntu2.6  
libcurl4-nss-dev 7.35.0-1ubuntu2.6  
libcurl4-gnutls-dev 7.35.0-1ubuntu2.6  
You should explicitly select one to install.  
E: Package ‘libcurl-dev’ has no installation candidate

2. File /home/plex/plexhometheater.sh should not be owned by root:  
-rwxr-xr-x 1 root root 126 Jun 16 08:22 /home/plex/plexhometheater.sh

Also, I did add the following lines to the startup script to disable pulse audio:

pactl suspend-sink 1 1  
export AE\_SINK=ALSA  
/opt/openpht/bin/plexhometheater  
pactl suspend-sink 1 0

Thanks!

---

<div class="post-metadata">

**Author:** ![blindy](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@blindy](https://forums.plex.tv/u/blindy)\
**Post date:** [June 17, 2016, 3:19am UTC](https://forums.plex.tv/t/ubuntu-script-to-install-openpht/148021/3 "2016-06-17T03:19:55Z")

</div>

> @vdimitrov said:  
> Tested on Ubuntu 14.04. Nicely done. Just two small issues:
> 
> 1. During sudo apt-get install  
> Package libcurl-dev is a virtual package provided by:  
> libcurl4-openssl-dev 7.35.0-1ubuntu2.6  
> libcurl4-nss-dev 7.35.0-1ubuntu2.6  
> libcurl4-gnutls-dev 7.35.0-1ubuntu2.6  
> You should explicitly select one to install.  
> E: Package ‘libcurl-dev’ has no installation candidate
> 
> 2. File /home/plex/plexhometheater.sh should not be owned by root:  
> -rwxr-xr-x 1 root root 126 Jun 16 08:22 /home/plex/plexhometheater.sh
> 
> Also, I did add the following lines to the startup script to disable pulse audio:
> 
> pactl suspend-sink 1 1  
> export AE\_SINK=ALSA  
> /opt/openpht/bin/plexhometheater  
> pactl suspend-sink 1 0
> 
> Thanks!

Thanks for the tips.

As for ALSA vs Pulse, users can see [PulseAudio Sink](http://forum.kodi.tv/showthread.php?tid=183436) and decide if the options are for them. I use pulse.

---

<div class="post-metadata">

**Author:** ![vdimitrov](https://avatars.discourse-cdn.com/v4/letter/v/e95f7d/32.png) [@vdimitrov](https://forums.plex.tv/u/vdimitrov)\
**Post date:** [June 20, 2016, 9:52pm UTC](https://forums.plex.tv/t/ubuntu-script-to-install-openpht/148021/4 "2016-06-20T21:52:08Z")

</div>

I see that you have updated the script to use the internal ffmpeg. Nice work!  
I tried it and it worked fine on Ubuntu 14.04 LTS except one small issue.  
It added the xbmc ppa even that it was already added to the sources.  
I think that the double hyphens mess up with the grep command. See below:

plex@htpc:~$ grep “team-xbmc-ppa” /etc/apt/sources.list /etc/apt/sources.list.d/\*  
plex@htpc:~$ grep “team.xbmc.ppa” /etc/apt/sources.list /etc/apt/sources.list.d/\*  
/etc/apt/sources.list.d/team-xbmc-ppa-trusty.list:deb [http://ppa.launchpad.net/team-xbmc/ppa/ubuntu](http://ppa.launchpad.net/team-xbmc/ppa/ubuntu) trusty main  
/etc/apt/sources.list.d/team-xbmc-ppa-trusty.list:deb-src [http://ppa.launchpad.net/team-xbmc/ppa/ubuntu](http://ppa.launchpad.net/team-xbmc/ppa/ubuntu) trusty main  
/etc/apt/sources.list.d/team-xbmc-ppa-trusty.list.save:deb [http://ppa.launchpad.net/team-xbmc/ppa/ubuntu](http://ppa.launchpad.net/team-xbmc/ppa/ubuntu) trusty main  
/etc/apt/sources.list.d/team-xbmc-ppa-trusty.list.save:deb-src [http://ppa.launchpad.net/team-xbmc/ppa/ubuntu](http://ppa.launchpad.net/team-xbmc/ppa/ubuntu) trusty main

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [June 21, 2016, 8:34am UTC](https://forums.plex.tv/t/ubuntu-script-to-install-openpht/148021/5 "2016-06-21T08:34:38Z")

</div>

@blindy

Good work, once you have a fully working script can I suggest that you add it to the Wiki [https://github.com/RasPlex/OpenPHT/wiki](https://github.com/RasPlex/OpenPHT/wiki) as I am sure that others would find this extremely beneficial and easy to locate, eventually this topic will disappear from the first page of this section.

Regards

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [June 26, 2016, 9:53pm UTC](https://forums.plex.tv/t/ubuntu-script-to-install-openpht/148021/6 "2016-06-26T21:53:19Z")

</div>

Deb packages now available for Ubuntu and Debian, see the 1.6.2 release notes (just released).

Regards.

---

<div class="post-metadata">

**Author:** ![zpaolo11x](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/zpaolo11x/32/18855_2.png) [@zpaolo11x](https://forums.plex.tv/u/zpaolo11x)\
**Post date:** [June 27, 2016, 8:36am UTC](https://forums.plex.tv/t/ubuntu-script-to-install-openpht/148021/7 "2016-06-27T08:36:35Z")

</div>

> @NedtheNerd said:  
> Deb packages now available for Ubuntu and Debian, see the 1.6.2 release notes (just released).

This is great, you guys are the best! May I suggest to edit the description of the “release” post adding Linux to the “Downloads” section where it says “For Windows, OS X and Embedded”?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [June 27, 2016, 8:50am UTC](https://forums.plex.tv/t/ubuntu-script-to-install-openpht/148021/8 "2016-06-27T08:50:04Z")

</div>

Thanks, will update.

Regards

---

<div class="post-metadata">

**Author:** ![blindy](https://avatars.discourse-cdn.com/v4/letter/b/439d5e/32.png) [@blindy](https://forums.plex.tv/u/blindy)\
**Post date:** [June 29, 2016, 2:05am UTC](https://forums.plex.tv/t/ubuntu-script-to-install-openpht/148021/9 "2016-06-29T02:05:37Z")

</div>

Updated original post now that official builds are available.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [January 8, 2020, 7:18pm UTC](https://forums.plex.tv/t/ubuntu-script-to-install-openpht/148021/10 "2020-01-08T19:18:51Z")

</div>


