bash – How do I add environment variables? – Ask Ubuntu

28 To permanently add a new environment variable in Ubuntu (tested only in 14.04), use the following steps: Open a terminal (by pressing Ctrl Alt T) sudo -H gedit /etc/environment Type your password Edit the text file just opened: e.g. if you want to add FOO=bar, then just write FOO=bar in a new line Save it Once saved, logout and login again.

https://askubuntu.com/questions/58814/how-do-i-add-environment-variables