Tuesday, April 11, 2017

Ubuntu + Kodi + IPTV + Exodus + Dropbox + Deluge cheatsheet

I have a very old laptop and want to use it as a HTPC, so I decided to install some light Ubuntu distribution and Kodi on it, accompanied by Deluge to download stuff using web interface, Dropbox for IPTV playlist and program guide and Exodus for VOD. Bellow I listed important terminal commands and other notes important for this setup to have them all in one place:
  1. First install Lubuntu or Xubuntu.
  2. Next add Kodi and Deluge repositories and update packages index:
    sudo add-apt-repository ppa:team-xbmc/ppa (Ubuntu repository has own version so this might be skipped)
    sudo add-apt-repository ppa:deluge-team/ppa (Ubuntu repository has own version so this might be skipped)
    sudo apt-get update
  3. Upgrade stuff:
    sudo apt-get upgrade
  4. Install stuff:
    sudo apt-get install kodi
    sudo apt-get install kodi-pvr-iptvsimple
    sudo apt-get install nautilus-dropbox (or download Ubuntu package from dropbox and install it with gdebi)
    sudo apt-get install deluged
    sudo apt-get install deluge-web
  5. Remove residual stuff:
    sudo apt-get autoremove
  6. Fix Dropbox:
    dropbox stop
    dbus-launch dropbox start
    Go to Dropbox preferences and disable "Start Dropbox on system startup"
    Open Autostart settings (in Lubuntu it is in "Default applications for LXSession", is Xubuntu it is in "Session and Startup") and add new item with command dbus-launch dropbox start
  7. Setup Deluge services:
    sudo leafpad /etc/systemd/system/deluged.service (in Xubuntu replace leafpad with mousepad, or any other text editor You like)
    sudo leafpad /etc/systemd/system/deluge-web.service
    Copy new files content from http://dev.deluge-torrent.org/wiki/UserGuide/Service/systemd.
    To use same account: in [Service] section change User line, remove line Group=deluge and add line Password=your_password. UMask line should also be removed.
    systemctl enable /etc/systemd/system/deluged.service
    systemctl enable /etc/systemd/system/deluge-web.service
    systemctl start deluged
    systemctl start deluge-web
    To auto-connect web UI to daemon:
    systemctl stop deluge-web
    sudo leafpad ~/.config/deluge/web-ui.conf
    Set default daemon to
    systemctl start deluge-web
  8. Set Kodi to auto start:
    sudo leafpad /etc/lightdm/lightdm.conf
    Add line autologin-session=kodi
    I had some issues here, after starting this way only laptop screen would work and TV connected over HDMI would be blank, so instead I added kodi to Autostart (in Lubuntu it is in "Default applications for LXSession", is Xubuntu it is in "Session and Startup")
  9. Add source to Kodi to install Indigo: http://fusion.tvaddons.ag/ Then use Indigo to install Exodus.
    Exodus is dead, use google to install Covenant or similar add-on instead.
    This might be good time to create folders Movies and TV Series in home folder and add them to Kodi and to Deluge.
    Also if using Exodus Covenant I would recommended to add Video Database Cleaner (direct link), otherwise library cleaning might take forever.
  10. Keep Ubuntu running when idle:
    There should be some options in Power Manager.
  11. Keep Ubuntu running when lid is closed:
    There should be some options in Power Manager, if not or they do not work then:
    sudo leafpad /etc/systemd/logind.conf
    Set HandleLidSwitch=ignore
    sudo leafpad /etc/UPower/UPower.conf
    Set IgnoreLid=true
  12. Set unattended upgrades:
    There should be options for that in Software & Updates, if not here are some resources to read: