It was supposed to be simple, but team-xbmc (or Launchpad, not sure) still doesn’t recognize Linux Mint 17.1 Rebecca as a separate linux distribution. So, the regular way described at the KODI website ( with sudo add-apt-repository ppa:team-xbmc/ppa at the terminal) doesn’t really work and you will probably end up with an error like the one below.
aptsources.distro.NoDistroTemplateException: Error: could not find a distribution template for LinuxMint/rebecca
 What you need to do to fix this, is manually edit your /etc/apt/sources.list file and add the following two lines at the end and save it. (Type
sudo gedit /etc/apt/sources.list to open it and paste.)
deb http://ppa.launchpad.net/team-xbmc/ppa/ubuntu trusty main deb-src http://ppa.launchpad.net/team-xbmc/ppa/ubuntu trusty main
Wait, you are not done yet, next part is to add the gpg key (its basically telling your computer to trust the sources you just added) otherwise, you’ll get error messages about untrusted packages. To add the gpg key, type exactly the following in the terminal.
gpg --keyserver keyserver.ubuntu.com --recv-keys 91E7EE5E gpg --export --armor 91E7EE5E | sudo apt-key add -
and you will see the following.
You can now proceed with the regular installation procedure for KODI (XBMC) Media Center.
sudo apt-get install python-software-properties pkg-config
sudo apt-get install software-properties-common
sudo apt-get update
sudo apt-get install kodi kodi-bin
 Alternate way to add the gpg key:
Visit this link and copy paste everything on a file and save it as “key”
Then open terminal and add the key with
sudo apt-key add ./key