Scripts to compile and install Kodi in Linx Debian/Ubuntu
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information. Small fixes. Nov 16, 2018 Change the libretro cores built a bit. Feb 2, 2019 File renamed. Feb 2, 2019 Number of CPUs is now automatic. Nov 16, 2018 Add support for Ubuntu Xenial Xerus. Jan 20, 2019 New building files for Ubuntu Bionic 18.04. Feb 2, 2019 Add support for Ubuntu Xenial Xerus. Jan 20, 2019 New required dependency. Jan 29, 2019 New building files for Ubuntu Bionic 18.04. Feb 2, 2019 MariaDB causes a compilation error on Ubuntu Xenial. Drop support for… Jan 20, 2019 Cosmetic changes. Dec 10, 2018 Cosmetic changes. Dec 10, 2018

Compile and install Kodi on Debian/Ubuntu distributions

Table of Contents

Readme me first

These scripts assume that:

  • The user running Kodi is named kodi.

  • The home folder of the kodi user is /home/kodi.

  • Kodi source code is located in /home/kodi/kodi-source/.

  • Kodi temporary build directory is /home/kodi/kodi-build/. You can safely delete it once Kodi has been compiled and installed.

  • Kodi will be installed in the directory /home/kodi/bin-kodi/.

  • Kodi user data directory is /home/.kodi/.

Once compiled and installed, you can execute Kodi in several ways:

$ /home/kodi/bin-kodi/bin/kodi

$ /home/kodi/bin-kodi/bin/kodi-standalone

$ /home/kodi/bin-kodi/lib/kodi/kodi-x11

The actual Kodi executable is /home/kodi/bin-kodi/lib/kodi/kodi-x11. The first two files are shell scripts that call the actual Kodi executable kodi-x11.

Cloning this repository

If you don't have git installed then execute as root user:

# apt-get install git

To clone this repository:

$ cd /home/kodi/
$ git clone

The Kodi compilation tools will be cloned into the directory /home/kodi/KodiInstall/.

Clone and prepare Kodi source code

As the kodi user clone the Kodi source code. This will take a while:

$ cd /home/kodi/
$ git clone kodi-source

If you want to compile a particular version of Kodi first have a look at the tags in the repository:

$ cd /home/kodi/kodi-source/
$ git tag

Each tag corresponds to a released version of Kodi. Now, tell git to set the Kodi source code to the version you want:

$ cd /home/kodi/kodi-source/
$ git checkout 17.6-Krypton

The Kodi source code is now ready for compilation.

Compile and installing Kodi for the first time

First you need to install the build dependencies required to compile Kodi. As root execute:

# cd /home/kodi/KodiInstall
# ./

As the kodi user, the Kodi build directory needs to be configured before compilation:

$ cd /home/kodi/KodiInstall/
$ ./

Now it's time to compile Kodi. This will take a while (about 15 minutes on a fast computer):

$ ./

Finally, to install Kodi, the Kodi binary addons and the required runtime files like the default skin execute:

$ ./

The first time you execute Kodi the userdata directory /home/.kodi/ will be created.

Now that Kodi is installed you can safely delete the Kodi build directory to save disk space:

$ ./

Do not purge the build directory before compiling the binary addons.

Compiling the Kodi binary addons

To compile all the binary addons:

$ cd /home/kodi/KodiInstall/
$ ./

or instead execute this if you are not going to use Kodi personal video recorder (PVR) features. This command compiles all binary addons except the PVR addons:

$ cd /home/kodi/KodiInstall/
$ ./

the binary addons are automatically installed in /home/kodi/bin-kodi/ after compilation.

To compile the Libretro cores (Kodi addons that let you play games) first edit the file /home/kodi/KodiInstall/ and comment/uncomment the Libretro cores you want to build. Note that building all the cores takes about 5/6 hours on a fast machine. Each MAME core takes 1 hour! Build only the cores you plan to use.

# --- Build the addons ---
# --- Uncomment the cores you want to build. Cores are shorted alphabetically.
# --- For a list of all cores see
# --- and look for the game.libretro.* addons.
# compile_core game.libretro.2048
# compile_core game.libretro.4do
compile_core game.libretro.beetle-bsnes
# compile_core game.libretro.beetle-gba

Finally, compile the Libretro cores:

$ cd /home/kodi/KodiInstall/
$ ./

the Libretro cores addons are automatically installed in /home/kodi/bin-kodi/ after compilation.

Update Kodi

Update Kodi source code:

$ cd /home/kodi-source/
$ git checkout master
$ git pull

If you wish to set a specific version:

$ git checkout 17.6-Krypton

Then configure, compile and install Kodi again:

$ cd /home/kodi/KodiInstall/
$ ./
$ ./
$ ./
$ ./
$ ./

If you plan to update Kodi frequently then do not execute to save compilation time (only files changed will be recompiled).


  • Compiling the binary addons with installs them in /home/kodi/bin-kodi/ even if Kodi has not been installed before.

  • The addons game.controller.* are not binary addons. They can be downloaded with the Kodi addon manager.

  • Kodi is built out-of-source but the binary addons are build inside the Kodi source.

  • Executing or updates the binary addons source code if it has been changed?

  • After a fresh installation all the binary addons are disabled. They must be enabled in Settings -> Addons -> My addons.

  • If a Libretro core is not installed the extensions it supports are not shown in the Games source filesystem browser. Libretro core addons must installed/enabled first.

Current bugs

  • If I execute any ROM I get the following dialog window "Add-on is incompatible due to unmet dependencies. Missing: game.controller.genesis.6button, game.controller.genesis.mouse"

    Kodi does not install game.controller.* addons automatically. Manually installing the addons solves the problem.

  • If there is no joystick plugged in then emulation does not start.

  • In the Kodi Wiki the following You will need to place them into the System Directory (linux example for pcsx bios files: ~/.kodi/userdata/addon_data/game.libretro.pcsx-rearmed/system/ ). is wrong. The correct directory is ~/.kodi/userdata/addon_data/game.libretro.pcsx-rearmed/resources/system/

  • If joystick is hot unplugged Kodi correctly detects that is has been unplugged and emulation does not start anymore. Interestingly, in Windows emulation starts when there is no gamepad, only keyboard.

22:46:37.511 T:140428854687488   ERROR: AddOnLog: Joystick Support: ScanEvents: failed to read joystick "Xbox 360 Wireless Receiver" on /dev/input/js0 - 19 (No such device)
22:46:38.921 T:140429205022464   ERROR: Previous line repeats 86 times.
22:46:38.921 T:140429205022464  NOTICE: UnregisterRemovedDevices - device removed from joystick/peripheral.joystick/0: Xbox 360 Wireless Receiver (0000:0000)
  • If joystick is hot plugged Kodi detects it OK. Emulation starts when a ROM is clicked. Interestingly, whenever a joystick is plugged emulation starts correctly even if controlling Kodi with the keyboard.
22:48:47.805 T:140429205022464  NOTICE: Register - new joystick device registered on addon->peripheral.joystick/1: Xbox 360 Wireless Receiver
  • Aspect ratio in core beetle_psx is wrong in Stretch mode Normal. Stretch mode 4:3 seems to work OK.

  • I cannot use the gamepad at all in beetle_psx, not even after remapping the controllers PlayStation Dual Analog and PlayStation Dual Shock.

  • Core prboom crashes if prboom.wad is not found. Kodi crashes as well.

  • Speed of prboom core is totally wrong. Core must be run at 35 FPS, otherwise speed is wrong. This problem also happens in Retroarch. A core that does frame interpolation like Crispy Doom or PrBoom+ is required.