Gecko 71 Posted October 3, 2023 Posted October 3, 2023 Hello the Emby Community I recently created a script to auto-update Emby-Server (on Ubuntu) today and wanted to share it with you. I know there are other versions on the forum, but none were customizable the way I wanted it to be. Here are the possibilities with this version : is able to look for stable only or any latest releases is able to fetch a specific release can ask for a user confirmation before installing anything (in case you run it manually) The script will never downgrade a version without asking you first, so there is no risk breaking Emby by downgrading from beta to stable. By default, only stable releases are installed AFTER asking your permission. Here's the help text : Auto-update Emby-Server to the very last version found on github ---------------------------------------------------------------- The user can either choose the stable or beta branch A user confirmation can be requested before installing a new version When no options are given : -> only Stable releases are looked for -> a user confirmation is mandatory Options: --stable Only look for the latest Stable release --latest Only look for the latest (Beta or Stable) release --version Specify a version to install as a 2nd argument If no argument is provided, display a list of all available versions on Github -s, --silent Do not ask for a user input when a new version is found -h, --help Print this help You can run it manually or to schedule it, you can copy the emby_updater.sh to any directory and then use the below script from the same directory. This will : copy the updater into the default directory of Emby (/opt/emby-server) activate the updater 5 minutes after every reboot (OnBootSec=5min) activate the updater every night at 6AM (OnCalendar=*-*-* 06:00:00) activate the update at any other time if the last start date was missed (Persistent=true) allow any new version, beta or stable (--latest flag) to be automatically installed (--silent flag) mkdir -p /opt/emby-server/updater cp emby_updater.sh /opt/emby-server/updater/ chmod +x /opt/emby-server/updater/emby_updater.sh echo "[Unit] Description=Auto-update Emby-Server on a schedule [Service] Type=oneshot ExecStart=/bin/bash /opt/emby-server/updater/emby_updater.sh --latest --silent " > /etc/systemd/system/emby_updater.service echo "[Unit] Description=Auto-update Emby-Server on a schedule [Timer] OnBootSec=5min OnCalendar=*-*-* 06:00:00 Persistent=true [Install] WantedBy=timers.target " > /etc/systemd/system/emby_updater.timer systemctl daemon-reload systemctl enable emby_updater.timer systemctl start emby_updater.timer Enjoy ! emby_updater.sh 1 2
bluesite 2 Posted December 13, 2023 Posted December 13, 2023 Hi, nice script thx if emby server is running i have so restart it after the update for automatic update i have enter the following lines after line 44 # stopping emby before updating echo -e " -> Stopping Emby-Server $emby_candidate_version ..." systemctl stop emby-server
Gecko 71 Posted December 14, 2023 Author Posted December 14, 2023 11 hours ago, bluesite said: Hi, nice script thx if emby server is running i have so restart it after the update for automatic update i have enter the following lines after line 44 # stopping emby before updating echo -e " -> Stopping Emby-Server $emby_candidate_version ..." systemctl stop emby-server Yeah the official updater should take care of the start&stop of the running Emby-server process but in case it doesn't, what you added is exactly what was missing in the script. You shouldn't have to restart it manually after the update thought as systemctl start emby-server is already in the script on line #63.
bluesite 2 Posted December 14, 2023 Posted December 14, 2023 if i run your script for the update i got the message on emby at the settings that i have to restart the service the service did not restart automaticly here
TMCsw 247 Posted December 15, 2023 Posted December 15, 2023 On 10/3/2023 at 11:17 AM, Gecko said: I know there are other versions on the forum, but none were customizable the way I wanted it to be. May I suggest you add something like this: ARC=$(dpkg –print-architecture) Then change the lines like: grep_filter=".*https://github.com/MediaBrowser/Emby.Releases/releases/download/${version}/emby-server-deb_${version}_amd64.deb\"$" To: grep_filter=".*https://github.com/MediaBrowser/Emby.Releases/releases/download/${version}/emby-server-deb_${version}_${ARC}.deb\"$" This should make it work for all (or at least most?) Debian based OS’s (Debian, Ubuntu, Mint, Mate... Pi(&Pi like...)...) that emby can run on. 2
raidflex 9 Posted January 2, 2024 Posted January 2, 2024 (edited) This script does not work for me on a LXC container using Ubuntu 22.04. I receive the below error. root@Emby:/opt/emby-server/updater# ./emby_updater.sh --latest --silent ./emby_updater.sh: line 135: syntax error near unexpected token `then' ./emby_updater.sh: line 135: ` if [[ $emby_installed_version == $emby_candidate_version ]] then' root@Emby:/opt/emby-server/updater# Edited January 2, 2024 by raidflex
raidflex 9 Posted January 6, 2024 Posted January 6, 2024 Nvm fixed the issue, just missing the ";" at the end of line 135.
Gecko 71 Posted January 9, 2024 Author Posted January 9, 2024 (edited) On 1/6/2024 at 7:27 PM, raidflex said: Nvm fixed the issue, just missing the ";" at the end of line 135. Gosh didn't saw that one, thank you for the correction ! I cannot update my initial post so here's the script with the updates and ideas from @bluesite, @raidflexand @TMCsw. Thanks you all! emby_updater.sh Edited January 9, 2024 by Gecko 1
raidflex 9 Posted January 9, 2024 Posted January 9, 2024 14 minutes ago, Gecko said: Gosh didn't saw that one, thank you for the correction ! I cannot update my initial post so here's the script with the updates and ideas from @bluesite, @raidflexand @TMCsw. Thanks you all! emby_updater.sh 8.97 kB · 0 downloads Thanks for the script it's working great! Just recently setup a Proxmox server and trying to get as much automated as possible. 1
Oratorian 41 Posted January 26, 2024 Posted January 26, 2024 I am testing a selfhosted repository that I created for emby. I took @Geckoscript, and modified it for my needs, It just checks for updated binaries, downloads them and puts them into the repo. At the moment it only supports the i386/amd64 releases of emby. I will add the others by due time. I created two releases, one for stable and one for beta. echo 'deb https://repo.amhosting.de/ubuntu beta main' > /etc/apt/sources.list.d/emby.list or echo 'deb https://repo.amhosting.de/ubuntu stable main' > /etc/apt/sources.list.d/emby.list The Repository is signed with the following Key : 3B6E90FE3203A81F Import it : curl -fsSl https://repo.amhosting.de/repo-key.pub | gpg --dearmor -o /etc/apt/trusted.gpg.d/repo.amhosting.gpg After that you should be able to install emby with sudo apt install emby-server This Repo also works for all Debian based systems. 2
bluesite 2 Posted May 18, 2024 Posted May 18, 2024 if i will update to latest beta i have to put the right version to get the latest beta when in enter emby_updater.sh --latest the only the latest stable will be find with emby_updater.sh --version it shows the beta version in the list with --latest it will find only the latest table but not beta
Oratorian 41 Posted May 18, 2024 Posted May 18, 2024 Github changed their json output in some way, which made @Geckofilter to grep the latest and/or stable always return the stable version. You can follow my post above yours if you use ubuntu to always update emby with your package manager apt. 13 minutes ago, bluesite said: if i will update to latest beta i have to put the right version to get the latest beta when in enter emby_updater.sh --latest the only the latest stable will be find with emby_updater.sh --version it shows the beta version in the list with --latest it will find only the latest table but not beta
Oratorian 41 Posted May 18, 2024 Posted May 18, 2024 I did a quick and dirty update to work with githubs new json output. I filter the output with jq So this update would need you to have the jq package installed. Quote apt install -y jq emby_updater.sh 1
requa3r0 12 Posted November 22, 2025 Posted November 22, 2025 (edited) Hi @Oratorian I tried the updater script, and made a small mistake. I installed latest..instead of stable. But...doing so I believe I found a few errors in your script Here is my log: Auto-updating Emby-Server ------------------------- > looking for any latest releases > the installation will be automatically performed if needed Getting Github latest version ... -> found : 4.9.2.6 Getting currently installed version ... -> found : 4.9.1.90 Installing Emby-Server 4.9.2.6 -> Downloading installer ... Prepended http:// to '4.9.2.6' -> Stopping Emby-Server 4.9.2.6 ... -> Installing Emby-Server 4.9.2.6 ... dpkg: warning: 'ldconfig' not found in PATH or not executable dpkg: warning: 'start-stop-daemon' not found in PATH or not executable dpkg: error: 2 expected programs not found in PATH or not executable Note: root's PATH should usually contain /usr/local/sbin, /usr/sbin and /sbin -> Cleaning ... rm: cannot remove '4.9.2.6': No such file or directory -> Starting Emby-Server 4.9.2.6 ... Installation complete ! 1: its showing stopping the wrong emby version - wrong variable echoed. 2: not sure which dependencies it needs. I have a clean new Debiaa 13 headless server. Perhaps include dependencies check for this in the script. 3: Not sure what it cant not remove. Perhaps again a wrong variable for the remove command. i wlll se if it does better on next stable version Thanks for a good update server. @LukeAny chance we can get such a service build in to the emby-server for the proper Linux versions ;:) Edited November 22, 2025 by requa3r0
Lessaj 467 Posted November 22, 2025 Posted November 22, 2025 A package repo will soon be available. Just wait. 1
requa3r0 12 Posted November 22, 2025 Posted November 22, 2025 41 minutes ago, Lessaj said: A package repo will soon be available. Just wait. Oh waw..that is even better news. We thank you for the good news..and will apt-get emby updates from now on. (hopefully) NB: NO SNAP I SURE HOPE ;O)
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now