Design a site like this with
Get started

Building you own Kodi-flavored Ubuntu Desktop with Cubic

I was experimenting with my HTPC setup and was looking for a “one-click-install” Kodi distribution for x86 PCs. …But there was only one… WTF?! Though Libreelec is looking good, at this point it is just not “there” in terms of availability of packages etc. and it was in beta. I wanted a snapcast server for multi-room audio, Flirc support and some other stuff and hit a road block pretty soon. On the other side of the spectrum there are many instructions to install Kodi standalone on a Debian or Ubuntu server installation. But these are pretty involved and I did not want to mess with the system too much, to stay update- and upgradeable.

I had been running Ubuntu Desktop with Kodi on my HTPC setup in the past and was quite happy with most of it, except its bloatware (snap and preinstalled software) and the fact that I always had to start from scratch. There is the wonderful Cubic (Custom Ubuntu ISO Creator) which lets you chroot into a linux iso and install packages / switch kernels / adjust settings etc. So I kind of worked my way backwards from the regular Ubuntu Focal Fossa 20.04.2 LTS Desktop to what I wanted in a Kodi install. Enter:


I called it “Kodibuntu”, because… obvious. It is based on Ubuntu Focal Fossa 20.04.2 LTS Desktop, but has:

  • Snap removed
  • A lot of cruft (office, browsers, games, printer / scanner support etc.) removed
  • Kodi, some audio encoders, some Bluray and Pycryptodome support installed
  • Snapcast server + client installed
  • Lirc and Flirc installed
  • “universe” repo enabled (needed by Kodi)
  • Weekly unattended security updates enabled (Other updates have to be done manually through “apt update && apt upgrade“)
  • Update pop-up / nag screen disabled due to uninstall of packagekit. Note that this removed the Gnome software installer too (but hey, there’s apt install, right?!)
  • File indexing aka tracker-miner disabled
  • “Do not disturb” in gnome enabled by default
  • Gnome lock screen disabled by default (also after suspend)
  • Opt-out from data-collection
  • Ethtool and wake on LAN service pre-installed (edit /etc/systemd/system/wol.service to set your NIC, enable using “sudo systemctl enable wol“)
  • ssh server pre-installed (but disabled)
  • Zstd compression used

En detail

Packages removed (–purge):

  • aisleriot
  • baobab
  • cups*
  • firefox*
  • foomatic-db-compressed-ppds
  • gdb*
  • genisoimage
  • gnome-calculator
  • gnome-calendar
  • gnome-characters
  • gnome-getting-started-docs*
  • gnome-initial-setup
  • gnome-mahjongg
  • gnome-mines
  • gnome-sudoku
  • gnome-system-monitor
  • gnome-todo*
  • gnome-user-docs*
  • gnome-video-effects
  • hunspell*
  • hyphen*
  • libreoffice*
  • mobile-broadband-provider-info
  • mythes*
  • orca
  • openprinting-ppds
  • packagekit
  • popularity-contest
  • printer-driver*
  • remmina*
  • rhythmbox*
  • shotwell*
  • simple-scan
  • sane*
  • snapd
  • thunderbird*
  • totem
  • transmission*
  • usb-creator*
  • ubuntu-docs*
  • wbrazilian wbritish wfrench witalian wngerman wogerman wportuguese wspanish wswiss (not wamerican)
  • xul-ext-ubufox
  • yelp*

Repositories / PPAs added:

Packages installed:

  • kodi
  • kodi-inputstream-adaptive
  • kodi-inputstream-rtmp
  • kodi-audioencoder-flac
  • kodi-audioencoder-lame
  • kodi-audioencoder-vorbis
  • kodi-audioencoder-wav
  • libbluray-bdj
  • lirc
  • build-essential
  • python3-dev
  • python3-pip
  • python3-setuptools
  • python packages: pycryptodomex websocket-client
  • snapserver snapclient
  • curl
  • flirc
  • ethtool
  • openssh-server


Remove packages
apt remove --purge aisleriot baobab cups* firefox* foomatic-db-compressed-ppds gdb* genisoimage gnome-calculator gnome-calendar gnome-getting-started-docs* gnome-mahjongg gnome-mines gnome-sudoku gnome-todo* gnome-video-effects gnome-characters gnome-initial-setup gnome-system-monitor gnome-user-docs* hyphen* hunspell* mobile-broadband-provider-info mythes* libreoffice* orca openprinting-ppds popularity-contest printer-driver* remmina* rhythmbox* shotwell* simple-scan sane* thunderbird* transmission* totem* ubuntu-docs* usb-creator* wbrazilian wbritish wfrench witalian wngerman wogerman wportuguese wspanish wswiss xul-ext-ubufox yelp*
Remove snap before install
apt remove --purge snapd


Enable “Do not disturb” and disable “lock on suspend” in gnome by default

Create file /usr/share/glib-2.0/schemas/90_ubuntu-custom.gschema.override containing:

show-banners = false

ubuntu-lock-on-suspend = false
lock-enabled = false

Then run:

glib-compile-schemas /usr/share/glib-2.0/schemas

See:, and

Disable tracker / file indexing
systemctl mask tracker-{miner-apps,miner-fs,store}

See:, and

Enable weekly unattended security updates

It makes sense to remove the Ubuntu package manager system “packagekit” first if you don’t want to see update popups:

apt remove --purge packagekit

Then enable unattended upgrades:

dpkg-reconfigure --priority=low unattended-upgrades

edit /etc/apt/10periodic:

APT::Periodic::Update-Package-Lists "7";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "14";
APT::Periodic::Unattended-Upgrade "1";

and /etc/apt/20auto-upgrades:

APT::Periodic::Update-Package-Lists "7";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "14";
APT::Periodic::Unattended-Upgrade "1";

See: and

Optional: Opt-out from data collection

Create file /etc/xdg/autostart/gnome-initial-setup-report-opt-out.desktop containing:

[Desktop Entry]
Name=GNOME Initial Setup Gnome settings
Exec=ubuntu-report -f send no
AutostartCondition=unless-exists gnome-initial-setup-done


Optional: Remove post-install dialog
apt remove --purge gnome-initial-setup


Remove orphaned packages
apt autoremove --purge && apt autoclean
Add universe and Kodi repositories
add-apt-repository universe
add-apt-repository ppa:team-xbmc/ppa
apt update && apt dist-upgrade
Install Kodi and related
apt install kodi kodi-inputstream-adaptive kodi-inputstream-rtmp kodi-audioencoder-flac kodi-audioencoder-lame kodi-audioencoder-vorbis kodi-audioencoder-wav libbluray-bdj lirc
Optional: Installing pycryptodomex + websocket-client for Netflix etc.
apt install build-essential python3-dev python3-pip python3-setuptools
pip3 install --user pycryptodomex websocket-client
Autostart Kodi

Add a file /etc/xdg/autostart/kodi.desktop is added, containing:

[Desktop Entry]


Optional: Installing Flirc
apt install curl
curl | sudo bash
Optional: Install snapcast
apt install snapsever snapclient
Optional: Snapcast server setup

Edit /etc/pulse/ and add an audio sink for the snapcast server:

### Set up snapcast server sink
load-module module-pipe-sink file=/tmp/snapfifo sink_name=Snapcast format=s16le rate=44100
update-sink-proplist Snapcast device.description="Snapcast" device.icon_name = "network-wired" device.form_factor="speaker"

Edit the snapcast server configuration file /etc/snapserver.conf and change:

sampleformat = 44100:16:2
buffer = 200

Edit the snapcast client options in /etc/default/snapclient to:

SNAPCLIENT_OPTS="--player pulse --host"

If you need to adjust the PulseAudio latency for snapcast (was not necessary for me), do that in /etc/environment and add:

# Adjust PulseAudio latency for snapcast server
Optional: Set up Wake-on-LAN

Install ethtool:

apt install ethtool

Add a file /etc/systemd/system/wol.service containing:

Description=Configure Wake-up on LAN

ExecStart=/sbin/ethtool -s enp2s0 wol g


Make sure you change enp2s0 to the NIC you want to use for WoL. See:

Optional: Add SSH access

Install a ssh server:

apt install openssh-server

Enable it:

systemctl enable ssh
Clean up package system
apt autoremove --purge && apt autoclean && apt clean
rm -rf /var/lib/apt/lists/*


The generated iso is not booting

Try fixing it with isohybrid (from the host, not chroot):
sudo apt install syslinux-utils
sudo isohybrid <YOUR_GENERATED_ISO>


Published by HorstBaerbel

Software developer by trade and interest, but I venture into the electronics- and diy-world from time to time.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: