Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Set system-wide environment variables in Ubuntu

Answer:

The recommended way now is to edit the file /etc/environment .

# vi /etc/environment
PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"

Add you key=value pairs into this file and save it.

  1. Set session-wide environment variables in Ubuntu
  2. Check current environment variables
  3. Install Java Runtime environment under Ubuntu
  4. Print current environment variables using printenv
  5. Print current environment variables

One Response to “Set system-wide environment variables in Ubuntu”

  1. [...] you want to have this path being set automatically, then follow this article. Share and [...]

Leave a Reply

(required)

(required)

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>