Jump to content

Emby Updater for Ubuntu/Linux


Recommended Posts

Posted (edited)

Remembered after... well, let's just say it's been a LONG time, that my emby-updater script was broken. Not sure if anyone else has posted anything in a while, so I finally just buckled down and wrote a new script to check and install updates for me and figured I'd share the wealth with anyone else who maybe wants it.

 

This script can be updated to work with any linux-based emby install, just change what you're downloading with wget and what you're using to install if it's not dpkg.

#!/bin/bash

# stop emby-server service before proceeding
systemctl stop emby-server

# may as well update everything else as well
apt-get update && apt-get -y upgrade

# wgets the latest ubuntu x64 debian installer
curl -s https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest | grep "emby-server-deb.*amd64.deb" | cut -d : -f 2,3 | tr -d \" | wget -qi -

# sets a couple variables for easy reference later
installer=`ls -b emby-server-deb*amd64.deb`
cur_ver=`dpkg-query -W emby-server | cut -f 2`
new_ver=`echo $installer | cut -d _ -f 2`

# checks to see if the current version of emby matches the downloaded version
if [ $cur_ver == $new_ver ]
then

    # if the versions match, don't try to install and just restart the emby-server service
    echo Same version, skipping install
    systemctl start emby-server
else

    # if there is a new version, go ahead and install it
    dpkg -i $installer
fi

# clean up the file I downloaded earlier
rm $installer
 
Edited by JarvisTek
  • Like 1
Posted (edited)

 

Remembered after... well, let's just say it's been a LONG time, that my emby-updater script was broken. Not sure if anyone else has posted anything in a while, so I finally just buckled down and wrote a new script to check and install updates for me and figured I'd share the wealth with anyone else who maybe wants it.

 

This script can be updated to work with any linux-based emby install, just change what you're downloading with wget and what you're using to install if it's not dpkg.

#!/bin/bash

# stop emby-server service before proceeding
systemctl stop emby-server

# may as well update everything else as well
apt-get update && apt-get -y upgrade

# wgets the latest ubuntu x64 debian installer
curl -s https://api.github.com/repos/MediaBrowser/Emby.Releases/releases/latest | grep "emby-server-deb.*amd64.deb" | cut -d : -f 2,3 | tr -d \" | wget -qi -

# sets a couple variables for easy reference later
installer=`ls -b emby-server-deb*amd64.deb`
cur_ver=`dpkg-query -W emby-server | cut -f 2`
new_ver=`echo $installer | cut -d _ -f 2`

# checks to see if the current version of emby matches the downloaded version
if [ $cur_ver == $cur_ver ]
then

    # if the versions match, don't try to install and just restart the emby-server service
    echo Same version, skipping install
    systemctl start emby-server
else

    # if there is a new version, go ahead and install it
    dpkg -i $installer
fi

# clean up the file I downloaded earlier
rm $installer

 

Hi, the variables in the bracket are the same, maybe it should look like

if [ $cur_ver == $new_ver ]
Edited by angusleung
  • Like 1
Posted

Thanks! Did do that late at night and I guess it shows, lol! Fixed the original so people don't have to go hunting and pecking for one that works.

  • 5 months later...
GWTPqZp6b
Posted

this is very useful, thanks. Do you know how to adapt to be able to pull the latest beta? (4.2.0.28 vs 4.1.1.0 as of my msg)

JarvisTek
Posted (edited)

35jy17.jpg

 

But seriously, just drop the "/latest" and it should* work.

*I haven't tested this and really don't plan on it

 

Edit - taking a quick peek between the regular "/latest" url and not, you'd probably have to add in some limiting for the grep as well like a "-m 1" or something since the normal "/latest" page only has the latest version for each platform and therefore doesn't have duplicates.

Edited by JarvisTek
GWTPqZp6b
Posted

I've been running beta's for a while in the man cave, I'm just being lazy :)

Dropping the /latest results in the script pulling down a lot of files, 

 

```

-rw-r--r-- 1 root root 19821048 Mar 21  2018 emby-server-deb_3.2.34.0_amd64.deb

-rw-r--r-- 1 root root 47945352 Mar 21  2018 emby-server-deb_3.2.35.0_amd64.deb
-rw-r--r-- 1 root root 50995724 Mar 21  2018 emby-server-deb_3.2.40.0_amd64.deb
-rw-r--r-- 1 root root 50958206 Mar 21  2018 emby-server-deb_3.2.50.0_amd64.deb
-rw-r--r-- 1 root root 47580030 Mar 22  2018 emby-server-deb_3.2.60.0_amd64.deb
-rw-r--r-- 1 root root 47739398 Mar 22  2018 emby-server-deb_3.2.70.0_amd64.deb
-rw-r--r-- 1 root root 47752942 Mar 22  2018 emby-server-deb_3.3.0.0_amd64.deb
-rw-r--r-- 1 root root 47747170 Mar 22  2018 emby-server-deb_3.3.1.0_amd64.deb
-rw-r--r-- 1 root root 50719070 May  2  2018 emby-server-deb_3.4.0.0_amd64.deb
-rw-r--r-- 1 root root 50719226 May  7  2018 emby-server-deb_3.4.1.0_amd64.deb
-rw-r--r-- 1 root root 53624290 Jul 20  2018 emby-server-deb_3.5.0.0_amd64.deb
-rw-r--r-- 1 root root 53637976 Jul 24  2018 emby-server-deb_3.5.1.0_amd64.deb
-rw-r--r-- 1 root root 53276062 Jul 29  2018 emby-server-deb_3.5.2.0_amd64.deb
-rw-r--r-- 1 root root 51496686 Sep 19  2018 emby-server-deb_3.5.3.0_amd64.deb
-rw-r--r-- 1 root root 57682160 Jan 20 09:56 emby-server-deb_4.0.0.2_amd64.deb
-rw-r--r-- 1 root root 57681342 Jan 21 14:01 emby-server-deb_4.0.1.0_amd64.deb
-rw-r--r-- 1 root root 57676782 Feb 12 14:15 emby-server-deb_4.0.2.0_amd64.deb
-rw-r--r-- 1 root root 61692792 Apr 19 17:01 emby-server-deb_4.1.0.26_amd64.deb
-rw-r--r-- 1 root root   225851 Jul 12 22:34 emby-server-deb_4.1.1.0_amd64.deb
-rw-r--r-- 1 root root 63382032 Jul  2 14:28 emby-server-deb_4.2.0.24_amd64.deb
-rw-r--r-- 1 root root 63377490 Jul 12 21:05 emby-server-deb_4.2.0.28_amd64.deb
-rwxr-xr-x 1 root root      985 Jul 12 22:34 update.sh

```

 

I'll look into it, thanks for the original script. 

  • 6 months later...
IkeTaylor11
Posted

@@Luke is there a reason the Emby software for Linux can't update itself? I have lots of apps on Linux that are capable of this, why can't Emby implement auto-update for Linux like it does for Windows? 

Posted

We just haven't gotten to it yet. Thanks.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...