HOW-TO:Install Kodi for Linux: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
(Added note that the PPA is unmaintained, and removed the recommendation to use it)
 
(163 intermediate revisions by 30 users not shown)
Line 1: Line 1:
{{mininav|[[General topics]]{{l2|[[Devices]]}}|[[Installing]]{{l2|[[Linux]]}}|page=HOW-TO:Install XBMC for Linux}}
{{Mininav|[[Linux]] {{L2| [[Installing]] }} }}
{{cleanup}}
:''See also: '''[[XBMC for Linux specific FAQ]]'''''


These are instructions for people who already have a Linux-based OS set up. If you have not installed a Linux-based OS yet, you might wish to try out [[XBMCbuntu]] which will install both the OS and XBMC with an easy installer.


==Official Team XBMC repositories==
== Installing Kodi on Ubuntu-based distributions with Team Kodi PPA ==


===Ubuntu===
'''Please note that currently the Team Kodi PPA is not maintained due to the previous sole maintainer stepping away from the responsibility. '''
;Repositories
*https://launchpad.net/~team-xbmc/+archive/ppa  '''ppa:team-xbmc/ppa'''
*https://launchpad.net/~team-xbmc/+archive/unstable  '''ppa:team-xbmc/unstable'''
*https://launchpad.net/~team-xbmc/+archive/xbmc-nightly  '''ppa:team-xbmc/xbmc-nightly'''


Frodo is available from Ubuntu 11.10 (Oneiric Ocelot) to 13.04 (Raring Ringtail), you can install from the team-xbmc PPA as follows or replace the ppa with the desired from above.
For now the only options are building from source, using Flatpak or a distro such as Debian which includes Kodi in their distribution.


<source lang="bash">
sudo apt-get install python-software-properties pkg-config
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:team-xbmc/ppa
sudo apt-get update
sudo apt-get install xbmc
</source><br />


For more details, see the [[HOW-TO install XBMC for Linux on Ubuntu, a Step-by-Step Guide]].
{{Warning|Ubuntu releases 16.04 LTS ("Xenial") or later, respectively, include their own Kodi builds in their official package repositories, customized to satisfy their interpretations of what is acceptable under their open-source mandates. If you have installed your distribution's Kodi packages, please purge them using the command <syntaxhighlight lang="shell" inline>sudo apt purge kodi\*</syntaxhighlight> before trying to install team-xbmc PPA packages.}}


===XBMCbuntu===
{{main|XBMCbuntu}}
{{#lst:XBMCbuntu|intro}}


==Standard OS repositories==
{{Warning|Releases from Team Kodi PPA are NOT compatible with Debian GNU / Linux and distributions built on top of Debian's binary package repositories! Please refer to '''Debian''' section of this page for installation instructions on such distributions!}}


A number of distributions now provide packages for XBMC. Since installation via distribution packages is simple (usually one or two commands) and the easiest way to get started, this section includes the minimum information on doing that. Distributions are listed in alphabetical order. Following the instructions provided should result in you having a working stand-alone XBMC installation.
See [[SFTP]] or [http://help.ubuntu.com/community/UsingTheTerminal Click here to find out how to use the terminal.]


===Arch===


As stable xbmc releases are already available through the '''community''' repository, please make sure you have it enabled in your '''/etc/pacman.conf'''. After that it's as simple as using pacman to install the most recent version of xbmc in the repository along with all of its dependencies:
=== Adding Team Kodi PPA repository ===


pacman -Sy xbmc
Use the command line terminal in Ubuntu, and enter the following commands. Follow the prompts as you would any other software installation.


===Foresight===
<syntaxhighlight lang="shell">
sudo apt install software-properties-common
sudo add-apt-repository -y ppa:team-xbmc/ppa
sudo apt install kodi
</syntaxhighlight>


xbmc is in official repositories and can be installed by running:
{{#lst:Official_Ubuntu_PPA|repos}}


sudo conary install xbmc
Note that this PPA only provides builds for Ubuntu i386 and Ubuntu amd64 but ''not for Ubuntu armhf'', which can run on a Raspberry Pi.


===Gentoo===


xbmc is in the official portage tree as media-tv/xbmc. Install with:
=== Installing binary add-ons (PVR, audio decoders, audio encoders, screensavers, visualizations, audio DSP) ===
  sudo emerge --autounmask xbmc
{{See|Ubuntu binary add-ons}}


===Mageia===


PVR-enabled XBMC is available in the official repositories. You can install it with the graphical package manager or with the following command:
=== Installing a development build ===
urpmi xbmc
{{See also|Development builds}}
To install a beta/unstable version of {{Kodi}} you must first add the unstable repository, then install XBMC. Use <code>ppa:team-xbmc/xbmc-nightly</code> for nightly builds and <code>ppa:team-xbmc/unstable</code> for [[Development_builds|beta]] builds.


Mageia 2 ships with XBMC 11.0 (Eden); Mageia 1 ships with XBMC 10.1 (Dharma). Both have opdenkamp's PVR support added.
<syntaxhighlight lang="shell">
sudo apt install software-properties-common
sudo add-apt-repository -y ppa:team-xbmc/xbmc-nightly
sudo apt install kodi
</syntaxhighlight>


===Mandriva===
Note that if you have any addons (such as PVR clients), these must be updated as well (they will not be updated automatically):
<syntaxhighlight lang="shell">
sudo apt install kodi-pvr-mythtv
</syntaxhighlight>


XBMC 10.1 (Dharma) with PVR support is available in '''contrib/updates''' of Mandriva 2010.1. You can install it with


urpmi xbmc
=== Upgrading ===
<section begin="Ubuntu upgrade" />
To update Kodi when a new version is released, just do a general system/package or use the following commands in the terminal (or via [[SFTP]]):


Mandriva 2009.1 and 2010.0 have older versions of XBMC that can be installed by running:
<syntaxhighlight lang="shell">
sudo apt update
sudo apt upgrade --with-new-pkgs
</syntaxhighlight>
<section end="Ubuntu upgrade" />


urpmi --searchmedia Backports xbmc


Of course, you can [http://wiki.mandriva.com/en/Docs/Basic_tasks/Installing_and_removing_software#Advanced_use:_Backports_and_candidate_updates install from contrib/backports] or from contrib/release using the GUI tool rpmdrake. Note that all these methods are most easily used if you have [http://wiki.mandriva.com/en/Docs/Basic_tasks/Installing_and_removing_software#Do_you_have_the_online_software_repositories_set_up_correctly.3F the full software sources enabled].
=== Downgrading to a stable version from a development version ===
If you install a nightly build or an unstable release and want to return to a stable release, follow these instructions:


===Debian===
Remove the unstable or nightly PPA:
<section begin="Debian"/>The Debian repository maintainers have [http://lists.alioth.debian.org/pipermail/pkg-multimedia-maintainers/2012-November/030327.html rejected] XBMC v12's entry into their default repository (which also feeds into the default Ubuntu repositories) due to the fact that XBMC uses an internal FFmpeg, instead of system wide libav, as demanded by Debian. XBMC is unable to do this currently for various reasons, one of which is that it would take a great amount of time to switch over to that library.
<syntaxhighlight lang="shell">
apt-cache policy | grep -Eo 'team-xbmc/(unstable|nightly)' | sudo xargs -r add-apt-repository -ryP
</syntaxhighlight>


See [[HOW-TO:Install XBMC for Linux#Debian_2|here]] for an alternative.<section end="Debian"/>
Then restore the stable version with the following commands:
<syntaxhighlight lang="shell">
sudo add-apt-repository ppa:team-xbmc/ppa
sudo apt-get update
sudo apt-get remove kodi kodi-x11
sudo apt-get install kodi
</syntaxhighlight>


==Third-party repositories==


===Ubuntu===
=== Downgrading between newer and older stable versions ===
;Wsnipex - Xvba and improved Vdpau (not mainline)
If you want to return to the next most recent stable release, follow these instructions:
*https://launchpad.net/~wsnipex/+archive/xbmc-xvba-frodo  '''ppa:wsnipex/xbmc-xvba-frodo'''
*https://launchpad.net/~wsnipex/+archive/xbmc-xvba  '''ppa:wsnipex/xbmc-xvba'''


;Nathan Renniewaldock (contains older Ubuntu support, etc)
Remove the current stable packages and PPA:
*https://launchpad.net/~nathan-renniewaldock/+archive/xbmc-stable  '''ppa:nathan-renniewaldock/xbmc-stable'''
<syntaxhighlight lang="shell">
*https://launchpad.net/~nathan-renniewaldock/+archive/xbmc-nightly  '''ppa:nathan-renniewaldock/xbmc-nightly'''
sudo apt purge kodi\*
sudo add-apt-repository -r ppa:team-xbmc/ppa
</syntaxhighlight>


===Fedora and CentOS===
Then install the "oldstable" version with the following commands:
<syntaxhighlight lang="shell">
sudo add-apt-repository -y ppa:team-xbmc/kodi-old
sudo apt install kodi
</syntaxhighlight>


xbmc builds for Fedora and CentOS 6 can be installed via the [http://rpmfusion.org/ RPM Fusion] set of repositories. Follow the [http://rpmfusion.org/Configuration RPM Fusion Configuration guide] to set up the repositories and install by running:


sudo yum install xbmc
=== Reverting to an earlier nightly ===
ALthough launchpad doesn't list older nightlies in their PPA, they are usually still available for download directly from the website. Visit the [https://launchpad.net/~team-xbmc/+archive/ubuntu/xbmc-nightly/+packages?field.name_filter=&field.status_filter=superseded&field.series_filter= xbmc-nightly repository index], where you will then have to download the appropriate .deb files and manually install them using <code>sudo dpkg -i [path to downloaded file]</code>.


===openSUSE===


xbmc is available in the [http://ftp.skynet.be/pub/packman/suse/ Packman] repository. To install, add the Packman repository ('''YaST (package manager) --> repositories --> repositories manager --> add --> community repositories'''), after which you can install by running:
=== Uninstalling ===
If you need to uninstall Kodi and purge its global configuration files (for instance, in the attempt to troubleshoot a persistent crash or other errors), do so by using the first of the following commands. If that fails to solve the issue, you will likely need to remove your user settings folder with all of your settings and library data to return to a state equivalent to what existed before Kodi was first installed on the system. This will not delete any videos or music, but just the settings and library data itself, but it is still recommended to keep a backup of them in case it's discovered that they weren't at issue and you are able to effect another solution. An example of how to accomplish a backup and then deletion of your user settings is provided on the last two lines, the highlighted one being responsible for making the backup which can thereafter be found in your home folder with the filename kodi-backup_''timestamp''.tar.xz.


sudo zypper in XBMC
<syntaxhighlight lang="shell" highlight="2-3">
sudo apt purge kodi\*
tar cf - "${HOME}/.kodi/" | xz -z9e - >"${HOME}/kodi-backup_$(date +%m%d%y-%H%M).tar.xz"
rm -Ri "${HOME}/.{kodi,xbmc}/"
</syntaxhighlight>


More information is available on the [[HOW TO install XBMC on openSUSE Linux]] page.


===Debian===
http://www.deb-multimedia.org/


===Debian Squeeze===
== Flatpak ==
Debian officially supports xbmc since Whezzy. However there are repositories which as well provide a xbmc for older debian-versions.
Excellent packages of recent xbmc versions (currently 12.0, updated regularly) for debian Squeeze (stable) can be found here:


http://debian.oppserver.net/xbmc/
If you want to use the flatpak version and do not know, if your distro supports flatpak check https://flatpak.org/setup/ for install instructions.


Instructions are in German but the code snippets regarding the adding of the sources should be understandable to anyone who speaks debian (or apt). Packages seem to be built from git repository and are updated at seemingly random times (probably based on the available time of the repository maintainers).
After you've sorted that, go to https://flathub.org/apps/tv.kodi.Kodi and hit the install button or copy the instructions at the end of the page to your terminal and execute them.


'''Please note:''' the packages in this repository depend on packages from debian-multimedia and debian backports, so you will have to add those to your sources.list as well!


== Autostarting XBMC ==
=== Beta channel ===
You can also run Kodi flatpak betas, if you install the flatpak beta remote.


There's several ways to start automatically XBMC:
<syntaxhighlight lang="shell" highlight="2-3">
* [[HOW-TO:Install_XBMC_for_Linux#Upstart_init_script|Upstart script xbmc.conf in /etc/init (short and sweet)]]
flatpak remote-add --if-not-exists flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo
* [[HOW-TO:Install_XBMC_for_Linux#Modify_the_inittab|Modifying the inittab (log winded)]]
</syntaxhighlight>
* [[HOW-TO:Install_XBMC_for_Linux#Add_a_new_init_script|Add a new init script]]


===Upstart init script===
Then install via
Create a '''<code>/etc/init/xbmc.conf</code>''' with following contents.
<syntaxhighlight lang="shell" highlight="2-3">
<source lang="xml">
flatpak install flathub-beta tv.kodi.Kodi
# xbmc-upstart
</syntaxhighlight>
# starts XBMC on startup by using xinit.
# by default runs as xbmc, to change edit below.
env USER=xbmc


description    "XBMC-barebones-upstart-script"
You should now have an entry on your system, that's labeled `Kodi (Beta)`, that you can use to run the beta. Be warned, it will use the same paths as the older versions, so they might clash. Usually they go along well, but make backups, if you need your data.
author          "Matt Filetto"


start on (filesystem and stopped udevtrigger)
stop on runlevel [016]


# tell upstart to respawn the process if abnormal exit
respawn


script
== Embedded/Appliance type install==
  exec su -c "xinit /usr/bin/xbmc --standalone -- -nocursor :0" $USER
end script
</source><br />


{{note|<code> -- -nocursor</code> option '''kills all X cursor''' on XBMC startup and does not interfere with mouse use/operation}}


You may have to edit '''<code>/etc/X11/Xwrapper.config</code>''' and replace the last line that says:
=== LibreELEC ===
{{main|LibreELEC}}
{{#lst:LibreELEC|intro}}


<source lang="xml">
allowed_users=console
</source>


to
== Third Party Repositories ==
<!-- Please only list repos that use an internal ffmpeg library -->


<source lang="xml">
The instructions in this section are for unofficial Linux binaries that are un/semi supported by Team Kodi. Most of those binaries use system ffmpeg or even worse totally untested libav, which is not recommended for {{kodi}} as we support ffmpeg only.
allowed_users=anybody
</source><br />


XBMC will now auto-start on boot and restart/respawn if killed or crashed.


=== Modify the inittab ===
=== Debian ===
Debian GNU/Linux ships its own '''Kodi from Debian''' flavor with following changes:


This was tested on Arch Linux.
* Only system libraries are used (no embedded third-party libraries except of libdvdread and libdvdnav)
* Old web interface (Chorus) is shipped to ensure Debian Free Software Guides (DFSG) compatibility


To automatically start xbmc on your system, do the following:
as well as a subset of Kodi binary addons packaged in [https://qa.debian.org/[email protected] main repository of Debian].




First you need to make some changes to <code>/etc/inittab</code>. Comment out (add a #) to this line:
{{Warning|'''Team Kodi offers no official support to "Kodi from Debian"!''' Please refer to links below for support!}}


<pre>
The support for Kodi from Debian is provided via the following channels:
id:3:initdefault
# [https://forum.kodi.tv/showthread.php?tid=363611 Kodi from Debian - Support Thread] on Kodi forums
</pre>
# [https://github.com/xbmc/xbmc/issues Github issues]
# [https://bugs.debian.org Debian Bug Tracker]


to


<pre>
==== Checking installed and available Kodi packages ====
#id:3:initdefault
</pre>


and uncomment
You can check what versions of Kodi and its binary add-ons are installed with the following command:


<pre>
<syntaxhighlight lang=bash>
id:5:initdefault
dpkg -l | grep kodi
</pre>
</syntaxhighlight>


Then add this line to the bottom:
To check what versions of Kodi are available, use this command:


<pre>
<syntaxhighlight lang=bash>
x:5:wait:login -f <YOUR_XBMC_USERNAME> </dev/tty7 &>/dev/tty7
apt-cache policy kodi*
</pre>
</syntaxhighlight>


Using wait instead of respawn means that you can exit out of xbmc into the console.


==== Installing Kodi on Debian Unstable or Testing ====


Installation of Kodi from Debian on Debian unstable ("sid") and testing is straightforward:


*NOTE*: This is a security hole as it autologins a dedicated xbmc user without asking for a password!
<syntaxhighlight lang=bash>
sudo apt update
sudo apt install kodi
</syntaxhighlight>


To install Kodi binary add-ons (like '''PVR IPTV Simple''', for example):


Now that we have the user logged in we need it to auto start XBMC.
<syntaxhighlight lang=bash>
In <code>~/.xinitrc</code> add the following to the end of the file
sudo apt install kodi-pvr-iptvsimple
(after removing/commenting any other exec lines that start a windowmanager):
</syntaxhighlight>


<pre>
'''NOTE''': Make sure user running Kodi belongs to the following groups
exec ck-launch-session xbmc
(for example, for user '''kodi''')
</pre>


<syntaxhighlight lang=bash>
$ groups kodi
kodi: cdrom,audio,render,video,plugdev,users,dialout,dip,input
</syntaxhighlight>


Add this line to your <code>~/.bash_profile</code>
This needs to be done to ensure Video Acceleration API (VA-API) is properly initialized during Kodi start-up and videos playing get acceleration using VAAPI and not VDPAU on Intel or AMD cards. To add user to groups, use the command:


<pre>
<syntaxhighlight lang=bash>
[[ $(tty) = "/dev/tty7" ]] && exec startx </dev/null &>/dev/null
usermod -a -G cdrom,audio,render,video,plugdev,users,dialout,dip,input kodi
</pre>
</syntaxhighlight>




And create a hushlogin file to suppress login messages.
==== Installing Kodi on Debian 10 "buster" ====


<pre>
By default, Debian buster users get Kodi 17.6 "Krypton". However, it is possible to get Kodi 19.x "Matrix" from buster-backports.
touch ~/.hushlogin
</pre>




Lastly, for the magic sauce that makes this work, add dbus to your daemons in <code>/etc/rc.conf</code>.
To get Kodi 17.6 and the corresponding add-ons, use the method described in '''Debian Unstable or Testing''' section above.


<pre>
DAEMONS=(... dbus ...)
</pre>


To get Kodi 19.x and the corresponding add-ons from Debian Backports:


You're finished. Next time you reboot you should be greeted with XBMC.
<syntaxhighlight lang=bash>
# Add Debian Backports repository for Debian 10 "buster"
if ! apt-cache policy 2>/dev/null | grep -q "http://.*buster-backports"; then
  echo "deb http://deb.debian.org/debian/ buster-backports main contrib" | sudo tee /etc/apt/sources.list.d/buster-backports.list
fi


=== Add a new init script ===
# Update APT lists
sudo apt-get update


This method works well under Debian. The current configuration is a HTPC running Debian Squeeze, with no window manager installed. The main goal here is to start an Xserver only for XBMC. It allows also to specify which user will start / own the XBMC process. This method will '''not work''' if you have a window manager installed (however, it should not be hard to modify the script to suit your needs)
# Install Kodi from backports:
sudo apt-get install {kodi,kodi-bin,kodi-data,kodi-repository-kodi,libspdlog1}/buster-backports


*Create a new script under '''/etc/init.d/'''. Call it '''xbmc'''
# (OPTIONAL) Install Kodi binary add-ons (for example, 'PVR IPTV Simple'):
*Change the rights, in order to allow it to be executable.
sudo apt-get install kodi-pvr-iptvsimple/buster-backports
<pre># chmod a+x /etc/init.d/xbmc</pre>
</syntaxhighlight>
*copy the code under in the file. Modify the variables to suit your configuration:
<pre>#! /bin/sh


### BEGIN INIT INFO
# Provides:          xbmc
# Required-Start:    $all
# Required-Stop:    $all
# Default-Start:    2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts instance of XBMC
# Description:      starts instance of XBMC using start-stop-daemon and xinit
### END INIT INFO


############### EDIT ME ##################
==== Installing Kodi on Debian 9 "stretch" ====


# path to xinit exec
By default, Debian stretch users get Kodi 17.1 "Krypton". No higher version is packaged in backports.
DAEMON=/usr/bin/xinit


# startup args
To get Kodi 17.1 and the corresponding add-ons, use the method described in '''Debian Unstable or Testing''' section above.
DAEMON_OPTS=" /usr/local/bin/xbmc --standalone -- :0"


# script name
NAME=xbmc


# app name
=== Raspberry Pi OS ===
DESC=XBMC
{{see also|HOW-TO:Install Kodi on Raspberry Pi}}
Installing on Raspberry Pi OS is done with:


# user
<syntaxhighlight lang=bash>
RUN_AS=sterfield
sudo apt-get install kodi
</syntaxhighlight>


# Path of the PID file
Upgrading on Raspberry Pi OS is done with:
PID_FILE=/var/run/xbmc.pid


############### END EDIT ME ##################
<syntaxhighlight lang=bash>
 
sudo apt-get update
test -x $DAEMON || exit 0
sudo apt-get upgrade
 
</syntaxhighlight>
set -e
 
case "$1" in
  start)
        echo "Starting $DESC"
        start-stop-daemon --start -c $RUN_AS --background --pidfile $PID_FILE  --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
        ;;
  stop)
        echo "Stopping $DESC"
        start-stop-daemon --stop --pidfile $PID_FILE
        ;;


  restart|force-reload)
        echo "Restarting $DESC"
        start-stop-daemon --stop --pidfile $PID_FILE
        sleep 5
        start-stop-daemon --start -c $RUN_AS --background --pidfile $PID_FILE  --make-pidfile --exec $DAEMON -- $DAEMON_OPTS
        ;;
  *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac


exit 0</pre>
*Test the script by trying to start / stop XBMC with it.
<pre># /etc/init.d/xbmc start
........
# /etc/init.d/xbmc stop</pre>
*If all is ok, you can add the script to your configuration, by issuing a "update-rc.d"
<pre># update-rc.d xbmc defaults</pre>
*If XBMC does not start, you may need to allow X to start from non-consoles.  Under Debian/Ubuntu, run:
<pre># dpkg-reconfigure x11-common</pre>
and choose "Anyone".
*You can now reboot the server, XBMC should be started just after the boot sequence.


==Installation from source==
== Installation from source ==
If distribution packages are not available, or you need a newer version, or specific features enabled, then you will most likely need to compile from source. See our '''[[Compiling Kodi]]''' guide.


If distribution packages are not available, or you need a newer version, or specific features enabled, then you will most likely need to compile from source. While compiling from source does not differ very much between distributions (except for installation of build dependencies), a few different guides are available in this wiki.


*[[HOW-TO compile XBMC for Linux from source code]]
{{Updated|20}}
*[[HOW-TO compile XBMC for Linux on Debian/Ubuntu]] - This is a tutorial on how to compile and install XBMC on Debian and Ubuntu.
*[[HOW-TO compile XBMC for Linux on Fedora Red Hat Enterprise Linux CentOS]] - This is a tutorial on how to install XBMC on Fedora 8/9/10, RHEL & CentOS 5.2.
*[[HOW-TO install XBMC for Linux on Arch Linux, a Step-by-Step Guide]]


[[Category:Linux]]
[[Category:Linux]]
[[Category:How-to]]
[[Category:How-to]]
[[Category:Installation|Linux]]
[[Category:Installation|Linux]]
[[Category:XBMC Manual]]

Latest revision as of 11:11, 14 January 2024

Home icon grey.png   ▶ Linux
▶ Installing
▶ HOW-TO:Install Kodi for Linux


Installing Kodi on Ubuntu-based distributions with Team Kodi PPA

Please note that currently the Team Kodi PPA is not maintained due to the previous sole maintainer stepping away from the responsibility.

For now the only options are building from source, using Flatpak or a distro such as Debian which includes Kodi in their distribution.


Stop hand.png Ubuntu releases 16.04 LTS ("Xenial") or later, respectively, include their own Kodi builds in their official package repositories, customized to satisfy their interpretations of what is acceptable under their open-source mandates. If you have installed your distribution's Kodi packages, please purge them using the command sudo apt purge kodi\* before trying to install team-xbmc PPA packages.


Stop hand.png Releases from Team Kodi PPA are NOT compatible with Debian GNU / Linux and distributions built on top of Debian's binary package repositories! Please refer to Debian section of this page for installation instructions on such distributions!


See SFTP or Click here to find out how to use the terminal.


Adding Team Kodi PPA repository

Use the command line terminal in Ubuntu, and enter the following commands. Follow the prompts as you would any other software installation.

sudo apt install software-properties-common
sudo add-apt-repository -y ppa:team-xbmc/ppa
sudo apt install kodi


The Kodi repositories are as follows:

Note: Although the URL still has "Team XBMC" in the title, these are the current URLs for Kodi.

https://launchpad.net/~team-xbmc/+archive/ppa ppa:team-xbmc/ppa Final release builds
https://launchpad.net/~team-xbmc/+archive/unstable ppa:team-xbmc/unstable Betas and release candidates
https://launchpad.net/~team-xbmc/+archive/xbmc-nightly ppa:team-xbmc/xbmc-nightly Nightly builds

Note that this PPA only provides builds for Ubuntu i386 and Ubuntu amd64 but not for Ubuntu armhf, which can run on a Raspberry Pi.


Installing binary add-ons (PVR, audio decoders, audio encoders, screensavers, visualizations, audio DSP)

See: Ubuntu binary add-ons


Installing a development build

To install a beta/unstable version of Kodi you must first add the unstable repository, then install XBMC. Use ppa:team-xbmc/xbmc-nightly for nightly builds and ppa:team-xbmc/unstable for beta builds.

sudo apt install software-properties-common
sudo add-apt-repository -y ppa:team-xbmc/xbmc-nightly
sudo apt install kodi

Note that if you have any addons (such as PVR clients), these must be updated as well (they will not be updated automatically):

sudo apt install kodi-pvr-mythtv


Upgrading

To update Kodi when a new version is released, just do a general system/package or use the following commands in the terminal (or via SFTP):

sudo apt update
sudo apt upgrade --with-new-pkgs


Downgrading to a stable version from a development version

If you install a nightly build or an unstable release and want to return to a stable release, follow these instructions:

Remove the unstable or nightly PPA:

apt-cache policy | grep -Eo 'team-xbmc/(unstable|nightly)' | sudo xargs -r add-apt-repository -ryP

Then restore the stable version with the following commands:

sudo add-apt-repository ppa:team-xbmc/ppa
sudo apt-get update
sudo apt-get remove kodi kodi-x11
sudo apt-get install kodi


Downgrading between newer and older stable versions

If you want to return to the next most recent stable release, follow these instructions:

Remove the current stable packages and PPA:

sudo apt purge kodi\*
sudo add-apt-repository -r ppa:team-xbmc/ppa

Then install the "oldstable" version with the following commands:

sudo add-apt-repository -y ppa:team-xbmc/kodi-old
sudo apt install kodi


Reverting to an earlier nightly

ALthough launchpad doesn't list older nightlies in their PPA, they are usually still available for download directly from the website. Visit the xbmc-nightly repository index, where you will then have to download the appropriate .deb files and manually install them using sudo dpkg -i [path to downloaded file].


Uninstalling

If you need to uninstall Kodi and purge its global configuration files (for instance, in the attempt to troubleshoot a persistent crash or other errors), do so by using the first of the following commands. If that fails to solve the issue, you will likely need to remove your user settings folder with all of your settings and library data to return to a state equivalent to what existed before Kodi was first installed on the system. This will not delete any videos or music, but just the settings and library data itself, but it is still recommended to keep a backup of them in case it's discovered that they weren't at issue and you are able to effect another solution. An example of how to accomplish a backup and then deletion of your user settings is provided on the last two lines, the highlighted one being responsible for making the backup which can thereafter be found in your home folder with the filename kodi-backup_timestamp.tar.xz.

sudo apt purge kodi\*
tar cf - "${HOME}/.kodi/" | xz -z9e - >"${HOME}/kodi-backup_$(date +%m%d%y-%H%M).tar.xz"
rm -Ri "${HOME}/.{kodi,xbmc}/"


Flatpak

If you want to use the flatpak version and do not know, if your distro supports flatpak check https://flatpak.org/setup/ for install instructions.

After you've sorted that, go to https://flathub.org/apps/tv.kodi.Kodi and hit the install button or copy the instructions at the end of the page to your terminal and execute them.


Beta channel

You can also run Kodi flatpak betas, if you install the flatpak beta remote.

flatpak remote-add --if-not-exists flathub-beta https://flathub.org/beta-repo/flathub-beta.flatpakrepo

Then install via

flatpak install flathub-beta tv.kodi.Kodi

You should now have an entry on your system, that's labeled `Kodi (Beta)`, that you can use to run the beta. Be warned, it will use the same paths as the older versions, so they might clash. Usually they go along well, but make backups, if you need your data.


Embedded/Appliance type install

LibreELEC

LibreELEC (short for "Libre Embedded Linux Entertainment Center") is small and very fast booting, open source JeOS (Just enough Operating System). LibreELEC is a complete media center software suite for embedded systems and computers, as it comes with a pre-configured version of Kodi and optional third-party PVR backend software.


Third Party Repositories

The instructions in this section are for unofficial Linux binaries that are un/semi supported by Team Kodi. Most of those binaries use system ffmpeg or even worse totally untested libav, which is not recommended for Kodi as we support ffmpeg only.


Debian

Debian GNU/Linux ships its own Kodi from Debian flavor with following changes:

  • Only system libraries are used (no embedded third-party libraries except of libdvdread and libdvdnav)
  • Old web interface (Chorus) is shipped to ensure Debian Free Software Guides (DFSG) compatibility

as well as a subset of Kodi binary addons packaged in main repository of Debian.


Stop hand.png Team Kodi offers no official support to "Kodi from Debian"! Please refer to links below for support!


The support for Kodi from Debian is provided via the following channels:

  1. Kodi from Debian - Support Thread on Kodi forums
  2. Github issues
  3. Debian Bug Tracker


Checking installed and available Kodi packages

You can check what versions of Kodi and its binary add-ons are installed with the following command:

dpkg -l | grep kodi

To check what versions of Kodi are available, use this command:

apt-cache policy kodi*


Installing Kodi on Debian Unstable or Testing

Installation of Kodi from Debian on Debian unstable ("sid") and testing is straightforward:

sudo apt update
sudo apt install kodi

To install Kodi binary add-ons (like PVR IPTV Simple, for example):

sudo apt install kodi-pvr-iptvsimple

NOTE: Make sure user running Kodi belongs to the following groups (for example, for user kodi)

$ groups kodi
kodi: cdrom,audio,render,video,plugdev,users,dialout,dip,input

This needs to be done to ensure Video Acceleration API (VA-API) is properly initialized during Kodi start-up and videos playing get acceleration using VAAPI and not VDPAU on Intel or AMD cards. To add user to groups, use the command:

usermod -a -G cdrom,audio,render,video,plugdev,users,dialout,dip,input kodi


Installing Kodi on Debian 10 "buster"

By default, Debian buster users get Kodi 17.6 "Krypton". However, it is possible to get Kodi 19.x "Matrix" from buster-backports.


To get Kodi 17.6 and the corresponding add-ons, use the method described in Debian Unstable or Testing section above.


To get Kodi 19.x and the corresponding add-ons from Debian Backports:

# Add Debian Backports repository for Debian 10 "buster"
if ! apt-cache policy 2>/dev/null | grep -q "http://.*buster-backports"; then
  echo "deb http://deb.debian.org/debian/ buster-backports main contrib" | sudo tee /etc/apt/sources.list.d/buster-backports.list
fi

# Update APT lists
sudo apt-get update

# Install Kodi from backports:
sudo apt-get install {kodi,kodi-bin,kodi-data,kodi-repository-kodi,libspdlog1}/buster-backports

# (OPTIONAL) Install Kodi binary add-ons (for example, 'PVR IPTV Simple'):
sudo apt-get install kodi-pvr-iptvsimple/buster-backports


Installing Kodi on Debian 9 "stretch"

By default, Debian stretch users get Kodi 17.1 "Krypton". No higher version is packaged in backports.

To get Kodi 17.1 and the corresponding add-ons, use the method described in Debian Unstable or Testing section above.


Raspberry Pi OS

Installing on Raspberry Pi OS is done with:

sudo apt-get install kodi

Upgrading on Raspberry Pi OS is done with:

sudo apt-get update
sudo apt-get upgrade


Installation from source

If distribution packages are not available, or you need a newer version, or specific features enabled, then you will most likely need to compile from source. See our Compiling Kodi guide.