There are two ways to set Environment Variables in Ubuntu.
1. This method will add/set environment variable just for current user session. For example you want to add “/home/imrankabir/.composer/vendor/bin/” to your environment variables.
2. To add/set environment variable permanently, open .profile hidden file in your ubuntu home directory. This will look some thing like this
# ~/.profile: executed by the command interpreter for login shells.
# This file is not read by bash(1), if ~/.bash_profile or ~/.bash_login
# see /usr/share/doc/bash/examples/startup-files for examples.
# the files are located in the bash-doc package.
# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
# if running bash
if [ -n “$BASH_VERSION” ]; then
# include .bashrc if it exists
if [ -f “$HOME/.bashrc” ]; then
# set PATH so it includes user’s private bin if it exists
if [ -d “$HOME/bin” ] ; then
Now add following line to this file (may be before “# if running bash” commented line) and save the file.