Editing the file is not enough. You need to source that file. This is done usually when you start bash, but if you edited the file, you can force to read the file with:
source ~/.bashrc
Note: some systems could restrict what file is parsed at start of bash (e.g. if the file is writable by "other", or just different requiring different files, but AFAIK it is not often done, but on special devices)
EDIT:
You wrote that you edited the file with sudo. this could be a problem: if your user cannot read that file, the file is ignored. .bashrc
is read as your user. But also this should not be a normal case: the files should already exists, and only bad editors will change permission of edited file.
man bash
and take a look at the INVOCATION part. This describes in details what files are used when. – pawel7318 Aug 24 '17 at 13:46sudo
to edit these files? They belong to your user, not to root. – Kusalananda Aug 24 '17 at 13:58. ~/.bashrc
? – Philippos Aug 24 '17 at 14:03~/.profile
but your question body says~/profile
. In which one did you actually put the environment variable? – Chris Davies Aug 24 '17 at 16:05