6

I have spent 6 hours researching, found PPA repositories and I see it there, but it will not install. I am new to Ubuntu and just trying to learn and hitting a road block here. Help!

I used these commands:

sudo add-apt-repository -r -y ppa:team-xbmc/ppa
sudo add-apt-repository -y ppa:team-xbmc/kodi-old
sudo apt-get update
sudo apt-get install kodi=2:16* kodi-bin=2:16*
andrew.46
  • 38,003
  • 27
  • 156
  • 232

3 Answers3

4

I would advise against building this older version of Kodi on Bionic Beaver but I have undertaken it as a challenge anyway! (And of course I realise that you have a very specific need for this version). It builds many older libraries, downloads a huge number of files and is just plain hard workI

However despite it being a somewhat arduous process this guide gave me a working copy of Kodi 16.1 on Bionic Beaver and should work well enough on your Bionic system as well if you decide to use it. I have exhaustively tested this on a fresh VM, consider testing it in a Virtual Machine yourself before committing to your main machine?

1. Download dependencies:

Dependencies for the Kodi package can be found using sudo apt-get build-dep kodi and this has assembled the following list which should be copied and pasted into a Terminal window. On a fresh Virtual Machine this was a 314mb download...

sudo apt-get install antlr autoconf automake autopoint autotools-dev \
build-essential ca-certificates-java cmake cmake-data cpp-6 curl debhelper \
default-jre default-jre-headless default-libmysqlclient-dev dh-autoreconf \
dh-python dh-strip-nondeterminism doxygen dpkg-dev fontforge-common \
fontforge-nox g++ g++-6 g++-7 gawk gcc gcc-6 gcc-6-base gcc-7 \
gir1.2-harfbuzz-0.0 googletest gperf groovy icu-devtools ivy java-common \
junit4 libantlr-java libao-dev libapache-pom-java libasan3 libasan4 libasm-java \
libasound2-dev libass-dev libass9 libatk-wrapper-java libatk-wrapper-java-jni \
libatomic1 libavahi-client-dev libavahi-common-dev libavcodec-dev libavcodec57 \
libavfilter-dev libavfilter6 libavformat-dev libavformat57 libavresample-dev \
libavresample3 libavutil-dev libavutil55 libbluetooth-dev libbluray-dev \
libbluray2 libboost-atomic1.65-dev libboost-atomic1.65.1 \
libboost-chrono1.65-dev libboost-chrono1.65.1 libboost-date-time1.65-dev \
libboost-dev libboost-serialization1.65-dev libboost-serialization1.65.1 \
libboost-system1.65-dev libboost-thread-dev libboost-thread1.65-dev \
libboost1.65-dev libbs2b0 libbsf-java libbz2-dev libc-dev-bin libc6-dev \
libcap-dev libcapnp-0.6.1 libcdio-dev libcec-dev libcec4 libchromaprint1 \
libcilkrts5 libclang1-6.0 libcommons-cli-java libcommons-lang-java \
libcommons-logging-java libcommons-parent-java libcrossguid-dev \
libcrossguid0 libcrystalhd3 libcurl4 libcurl4-gnutls-dev libcwiid-dev \
libcwiid1 libdbus-1-dev libdrm-dev libegl1-mesa-dev libexpat1-dev \
libfile-stripnondeterminism-perl libflite1 libfluidsynth1 libfontconfig1-dev \
libfontforge2 libfreetype6-dev libfribidi-dev libfstrcmp-dev libfstrcmp0 \
libgcc-6-dev libgcc-7-dev libgcrypt20-dev libgdraw5 libgif-dev libgif7 \
libgl1-mesa-dev libgles2-mesa-dev libglib2.0-dev libglib2.0-dev-bin \
libglu1-mesa-dev libglvnd-core-dev libglvnd-dev libgme0 libgmp-dev \
libgmpxx4ldbl libgnutls-dane0 libgnutls-openssl27 libgnutls28-dev \
libgnutlsxx28 libgpg-error-dev libgraphite2-dev libgsm1 libgtest-dev \
libhamcrest-java libharfbuzz-dev libharfbuzz-gobject0 \
libhawtjni-runtime-java libibus-1.0-dev libice-dev libicu-dev \
libicu-le-hb-dev libicu-le-hb0 libiculx60 libidn2-0-dev libidn2-dev \
libiso9660-10 libiso9660-dev libitm1 libjansi-java libjansi-native-java \
libjline2-java libjpeg-dev libjpeg-turbo8-dev libjpeg8-dev libjsoncpp1 \
liblcms2-dev liblsan0 libltdl-dev liblzo2-dev libmad0 libmicrohttpd-dev \
libmicrohttpd12 libmirclient-dev libmirclient9 libmircommon-dev \
libmircommon7 libmircookie-dev libmircookie2 libmircore-dev libmircore1 \
libmirprotobuf3 libmodplug-dev libmodplug1 libmpx2 libmysofa0 \
libmysqlclient-dev libmysqlclient20 libnfs-dev libnfs11 libnorm1 libopengl0 \
libopenjp2-7 libopenmpt0 libp11-kit-dev libp8-platform-dev libp8-platform2 \
libpcre16-3 libpcre3-dev libpcre32-3 libpcrecpp0v5 libpgm-5.2-0 libplist-dev \
libpng-dev libpostproc-dev libpostproc54 libprotobuf-dev libprotobuf-lite10 \
libpthread-stubs0-dev libpulse-dev libpython-dev libpython-stdlib \
libpython2.7-dev libqdox-java librhash0 librsvg2-bin librubberband2 \
libsdl2-2.0-0 libsdl2-dev libsdl2-image-2.0-0 libsdl2-image-dev \
libsdl2-mixer-2.0-0 libsdl2-mixer-dev libservlet3.1-java libset-scalar-perl \
libshairport-dev libshairport2 libshine3 libsigsegv2 libsm-dev \
libsmbclient-dev libsnappy1v5 libsndio-dev libsndio6.1 libsoxr0 libspiro0 \
libsqlite3-dev libssh-gcrypt-4 libssh-gcrypt-dev libstdc++-6-dev \
libstdc++-7-dev libswresample-dev libswresample2 libswscale-dev libswscale4 \
libtag1-dev libtasn1-6-dev libtinyxml-dev libtinyxml2.6.2v5 libtool libtsan0 \
libubsan0 libudev-dev libunbound2 libuninameslist1 libuv1 libva-dev \
libva-drm2 libva-glx2 libva-wayland2 libva-x11-2 libva2 libvdpau-dev \
libvdpau1 libwayland-bin libwayland-dev libx11-dev libx11-xcb-dev \
libx264-152 libx265-146 libxau-dev libxcb-dri2-0-dev libxcb-dri3-dev \
libxcb-glx0-dev libxcb-present-dev libxcb-randr0-dev libxcb-render0-dev \
libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb1-dev \
libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev \
libxi-dev libxinerama-dev libxkbcommon-dev libxml2-dev libxmu-dev \
libxmu-headers libxpp3-java libxrandr-dev libxrender-dev libxshmfence-dev \
libxslt1-dev libxss-dev libxstream-java libxt-dev libxv-dev libxvidcore4 \
libxxf86vm-dev libyajl-dev libzmq5 libzvbi-common libzvbi0 linux-libc-dev m4 \
make mesa-common-dev mysql-common nettle-dev openjdk-11-jre \
openjdk-11-jre-headless pkg-config po-debconf python python-dev \
python-minimal python-pil python2.7 python2.7-dev python2.7-minimal \
python3-distutils python3-lib2to3 swig swig3.0 uuid-dev valgrind \
x11proto-core-dev x11proto-damage-dev x11proto-dev x11proto-dri2-dev \
x11proto-fixes-dev x11proto-gl-dev x11proto-input-dev x11proto-randr-dev \
x11proto-scrnsaver-dev x11proto-xext-dev x11proto-xf86vidmode-dev \
x11proto-xinerama-dev xorg-sgml-doctools xtrans-dev yasm zlib1g-dev \
checkinstall libglew-dev libmpeg2-4-dev liblogg4-dev libtiff-dev \
libssl-dev libcrypto++-dev libusb-dev liblockfile-dev

2. Make a build directory & download source:

Now create a build directory, change to it and download and extract the source for Kodi 16.1. Use the following commands one at a time:

mkdir $HOME/kodi_build && cd $HOME/kodi_build
wget https://github.com/xbmc/xbmc/archive/16.1-Jarvis.tar.gz
tar xvf 16.1-Jarvis.tar.gz

A patch is required to enable cximage to build with the newer gcc and the following 1 line command will download this patch from an older Kodi commit:

wget https://github.com/xbmc/xbmc/commit/8f82e51563f0e1bc9b7a8adf669ad2b66e7ce3e5.patch \
-O kodi_16.1_cxximage_gcc_fix.diff

3. Build kodi:

First to create the required autobuild tools / configuration:

cd $HOME/kodi_build/xbmc-16.1-Jarvis
./bootstrap

And now to build, download, compile and install even more required dependencies. I have divided these into sections for the sake of (hopefully) some clarity:

i) Build some dependencies from the Kodi extras folder:

Kodi has a build system in place for some of the more awkward dependencies and we use it here. Use the following commands 1 at a time:

sudo make -C tools/depends/target/crossguid PREFIX=/usr/local
sudo make -C tools/depends/target/libdcadec PREFIX=/usr/local

ii) Find a decent copy of Jasper:

Jasper is gone from Ubuntu so retrieve it from our Debian colleagues, use the following commands one at a time in the given sequence: :

wget http://security.debian.org/debian-security/pool/updates/main/j/jasper/libjasper1_1.900.1-13+deb7u6_amd64.deb
wget http://security.debian.org/debian-security/pool/updates/main/j/jasper/libjasper-dev_1.900.1-13+deb7u6_amd64.deb
sudo dpkg -i libjasper1_1.900.1-13+deb7u6_amd64.deb
sudo dpkg -i libjasper-dev_1.900.1-13+deb7u6_amd64.deb

iii) Compile the older required version of libcec:

This version of kodi wants an older version of libcec and the following will install this. Not ideal using these older versions but this is part of the price to building older software on a newer release...

First for libplatform (required by libcec), from the Xenial xbmc PPA:

wget http://ppa.launchpad.net/team-xbmc/ppa/ubuntu/pool/main/p/platform/libplatform2_2.0.1-1~xenial_amd64.deb
wget http://ppa.launchpad.net/team-xbmc/ppa/ubuntu/pool/main/p/platform/libplatform-dev_2.0.1-1~xenial_amd64.deb
sudo dpkg -i libplatform2_2.0.1-1~xenial_amd64.deb
sudo dpkg -i libplatform-dev_2.0.1-1~xenial_amd64.deb

And then to compile the required version of libcec and install it to /usr/local:

cd $HOME/kodi_build
wget https://github.com/Pulse-Eight/libcec/archive/libcec-3.0.0.tar.gz
tar xvf libcec-3.0.0.tar.gz && cd libcec-libcec-3.0.0
mkdir build && cd build
cmake ..
make && sudo make install

iv) Compile kodi:

Finally to compile and patch the Kodi source:

(Note that the upcoming ./configure process will download and use its own copy of FFmpeg, this can be disabled but for this build we will allow it to happen! Details of this process are contained in tools/depends/target/ffmpeg).

cd $HOME/kodi_build/xbmc-16.1-Jarvis
patch -p1 < ../kodi_16.1_cxximage_gcc_fix.diff
./configure --disable-wayland
make -j 4
sudo make install

5. Obligatory screenshot:

Below is a screenshot of Kodi 16.1 running on my Bionic Beaver system:

enter image description here

You will need to test this version to ensure that all appropriate options have been used to meet your specific needs. Tweaking is always possible :).

Notes:

The Kodi configuration created by following this guide is as follows, there are a few sections marked as 'No' which could doubtless be worked on if required:

------------------------
  Kodi Configuration:
------------------------
  Kodi Version: 16.1
  git Rev.: Unknown
  Debugging:    Yes
  Profiling:    No
  Optimization: Yes
  SWIG Available:   Yes
  JRE Available:    Yes
  Doxygen Available:    Yes
  Crosscomp.:   No
  target ARCH:  
  target CPU:   
  OpenGL:   Yes
  ALSA:     Yes
  DBUS:     Yes
  VDPAU:    Yes
  VAAPI:    Yes
  VTBDecoder:   No
  OpenMax:  No
  Joystick: Yes
  Touch skin:   No
  X11:      Yes
  Wayland:  No
  Bluray:   Yes
  TexturePacker:Yes
  MID Support:  No
  ccache:   No
  ALSA Support: Yes
  PulseAudio:   Yes
  DVDCSS:   Yes
  Google Test Framework Configured: Yes
  Google Breakpad Configured:   No
  Avahi:    Yes
  mDNSEmbedded: No
  Non-free: Yes
  ASAP Codec:   No
  MySQL:    Yes
  Webserver:    Yes
  libssh support:   Yes
  libRTMP support:  No
  libsmbclient support: Yes
  libnfs client support:Yes
  libgif support:   Yes
  AirPlay support:  Yes
  AirTunes support: No
  UPnP support:     Yes
  Optical drive:    Yes
  libudev support:  Yes
  libusb support:   No
  libcec support:   Yes
  libcap support:   Yes
  additional players:   No
  additional codecs:    No
  prefix:   /usr/local
------------------------
andrew.46
  • 38,003
  • 27
  • 156
  • 232
  • Holy crap @andrew.46 that is awesome. I downgraded to 16.04 to get 16.1 but now I may reinstall and compile. Thank you so much, you are the man. – Shane Greenfield Jul 26 '18 at 04:05
  • @ShaneGreenfield Perhaps be cautious and try building this on an 18.04 VM first... – andrew.46 Jul 26 '18 at 04:29
  • @andrew.46 this is no longer working in 18.04.4 :( Any chance you want to tackle again!??! – FreeSoftwareServers Feb 17 '20 at 21:27
  • It was during configure, something about DVD failing. This was actually my first dive into docker and I'd say my method is the better method at this point, but I totally know the desire to challenge something and I'd like the choice of GUI/Headless. At this point I was forced to go headless. – FreeSoftwareServers Feb 18 '20 at 07:21
2

The PPA you used has “old” in its name. This indicates it won’t likely work with new Ubuntu Bionic Beaver (18.04) – the newest Ubuntu release supported by this PPA is Xenial (16.04).

If you are OK with the current Kodi version, there is a “Kodi” team PPA without the “old” suffix, so please use:

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

This will install the current version 2:17.6+git20180430.1623-final-0bionic when running on Ubuntu Bionic.

If you explicitly want to install Kodi Jarvis (version 16), then you should consider using Ubuntu 16.04 which is still supported (until 2021). If you don’t want to leave your current version, you can dual-boot the two Ubuntu versions or virtualize one of them. You can also try to build Kodi Jarvis for 18.04 yourself but it might be quite difficult.

Melebius
  • 11,431
  • 9
  • 52
  • 78
0

As I tried andrew.46's answer today and was unsuccessful I researched alternatives. I use this version of Kodi because my clients do as OP as commented as well and likely many are here for the same reason. Therefor a headless client is actually better/preferred and currently what I believe is the only option for Ubuntu 18.

There is a maintained docker image of kodi-headless:Jarvis which runs on Ubuntu 18 and can be setup as follows:

Note: This is not the most secure method of setup possible, the container runs as root, has access to host network etc. I leave it to end user to research security features.

Also, configs are stored under /root/.kodi/ on the host OS. I never had to touch the CLI in the kodi container, just moved my current userdata to /root/.kodi/ launch container and test!

Install Docker:

cat << 'EOL' >apt_docker_install.sh
sudo apt-get remove -y docker docker-engine docker.io containerd runc
sudo apt-get update
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io
sudo docker run hello-world
EOL
chmod +x apt_docker_install.sh
./apt_docker_install.sh

Setup DB:

sudo apt-get update
sudo apt-get install -y mariadb-server mariadb-client
cat /etc/mysql/mariadb.conf.d/50-server.cnf | grep bind
sed -i -e 's|127.0.0.1|0.0.0.0|g' /etc/mysql/mariadb.conf.d/50-server.cnf
cat /etc/mysql/mariadb.conf.d/50-server.cnf | grep bind
systemctl restart mysql
systemctl status mysql
mysql
CREATE USER 'kodi' IDENTIFIED BY 'kodi';
GRANT ALL PRIVILEGES  ON MyVideos99.* TO 'kodi';
GRANT ALL PRIVILEGES  ON MyMusic56.* TO 'kodi';
flush privileges;
exit;

Create Kodi Container:

cd ~
cat << 'EOL' >kodi_jarvis_bionic_beaver.sh
docker pull linuxserver/kodi-headless:Jarvis
docker create --name=kodi-headless --net=host -e PGID=0 -e PUID=0  -v /root/.kodiconfig:/config/.kodi -e VERSION=16 linuxserver/kodi-headless:Jarvis
#Note: All configs now under ~/.kodi/ on host
docker start kodi-headless
cd ~
echo "alias kodicli='docker exec -it kodi-headless /bin/bash'" >> .bashrc
source .bashrc
kodicli
EOL
chmod +x kodi_jarvis_bionic_beaver.sh
./kodi_jarvis_bionic_beaver.sh

Autostart Container:

cat << 'EOL' >/etc/systemd/system/kodi-headless.service
[Unit]
Description=Some service
Requires=docker.service
After=docker.service

[Service]
Restart=always
ExecStart=/usr/bin/docker start -a kodi-headless
ExecStop=/usr/bin/docker stop -t 2 kodi-headless

[Install]
WantedBy=multi-user.target
EOL
systemctl enable kodi-headless

Sources:

https://hub.docker.com/r/linuxserver/kodi-headless/

https://libraries.io/github/linuxserver/docker-kodi-headless

https://github.com/linuxserver/docker-kodi-headless