Skip to content

Instantly share code, notes, and snippets.

@ampaze
Created January 18, 2023 10:55
Show Gist options
  • Save ampaze/307ddc2227041d956c69e731ed147cb6 to your computer and use it in GitHub Desktop.
Save ampaze/307ddc2227041d956c69e731ed147cb6 to your computer and use it in GitHub Desktop.
How to set environment variables (for example no_proxy) for Kodi in OSMC (Open Source Media Center)

As Kodi is called with sudo -u osmc environment variables are not retained and as a result not available in Kodi.

The easiest way I have found to set environment variables like for example no_proxy is to add them to /etc/environment and then configure sudo to include /etc/environment on every invocation.

You need SSH access to the device

ssh osmc@device

sudo sh -c 'echo "Defaults        env_file=/etc/environment" > /etc/sudoers.d/osmc-environment'
echo "no_proxy=nas" >> /etc/environment

systemctl restart mediacenter
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment