Set the environment variable for RHEL 7.3 for root user

I managed to set the environment variable for my user imin by editing the .bash_profile under folder /home/imin and added the path to my php 71 bin. Now when I run echo $ PATH it shows the changes that I made, but now I need to do the same for my root.

If I run echo $ PATH under my user imin, it returns /usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/imin/.local/bin:/home/imin/bin:/opt/rh/rh-php71/root/usr/bin

So all is fine and dandy. But for my user root, I tried adding the line /opt/rh/rh-php71/root/usr/bin at /root/.bash_profile and /etc/skel/.bash_profile but when I tried running echo $ PATH it doesn’t show the changes that I made. Instead it just show /sbin:/bin:/usr/sbin:/usr/bin.

And since I couldn’t get my rh-php71 bin inside my root PATH variable, I can’t run php.

I have tried find |grep .bash_profile and it just return

./etc/skel/.bash_profile ./root/.bash_profile 

and other folders under /home/.

So where should I actually edit to have my root’s PATH updated?


Update: Also added the line export PATH="$ PATH:/opt/rh/rh-php71/root/usr/bin" to /root/.bashrc as per Aroly7’s answer below, but it still doesn’t show in ECHO $ PATH.

Here’s my /root/.bashrc now:

# .bashrc  # User specific aliases and functions  alias rm='rm -i' alias cp='cp -i' alias mv='mv -i'  # Source global definitions if [ -f /etc/bashrc ]; then         . /etc/bashrc fi  export PATH="$  PATH:/opt/rh/rh-php71/root/usr/bin" 

How can I make macOS respect HOSTALIASES environment variable?

According to the Apple developer documentation, setting HOSTALIASES will make a process look in that file for hostnames instead of /etc/hosts.

However when I tested this with ping and a replacement hostfile, the replacement never got used, only /etc/hosts (according to fs_usage) – I have also seen similar complaints online.

Is there a way to get a process to respect HOSTALIASES or otherwise use a different hosts file?

Can’t boot after lubuntu-desktop environment

I have two problems.

Problem 1 : My old laptop is running Ubuntu 18.04 (Unity). I was trying other desktop environments like Gnome yesterday, and I wanted to try Lubuntu, so I installed it using this command :

sudo apt-get install lubuntu-desktop

When it got installed, it was running fine. But after a reboot – after showing “Lubuntu” sign, there is this black screen. (Hence, I can’t login) All I can do is, ctrl + alt + f3 and get into the console. So after searching in the internet, I uninstalled lubuntu-desktop using

sudo apt-get remove lxde

sudo apt-get remove lubuntu-desktop

(or something of that sort after logging into the console.)

I tried reinstalling ubuntu desktop, lightdm and nvidia drivers but still nothing.

How can I get it back to work?

Also, how can I safely install a desktop environments?

I remember having a hard time long time ago as well, with Gnome. :S

Problem 2 : This old laptop can boot into Ubuntu 18.04, 15.04, Archlinux and Windows 10. The home folder on Ubuntu 18.04 is encrypted with ecryptfs. (Or maybe even LUKS? I’m not too sure) How do I access it from ubuntu 15.04?

install and uninstall tensorflow from environment

I installed the gpu tensorflow with conda with environment tensorflow

source activate tensorflow 

I try to reinstall it with cuda-10 and tensorflow 2.0
but the previous version keep conflict with net version
so I want to remove all tensorflow from environment

I uninstall it with

pip uninstall tensorflow  conda remove tensorflow  

but it keep import it
import tensorflow has no problem
How do I check all tensorflow installed and remove it ?

Subsites are redirecting to localhost after alternative access mapping in sharepoint production Environment

Subsites are redirecting to localhost after alternative access mapping in sharepoint production Environment.

    Because of this the public url is redirecting to the default port url.      Please help any one regarding this issue. 



Using linux environment variable in rsyslog template

I’m trying to add an environment variable to my rsyslog template.
I tried using ‘getenv()’ function without any luck, I always get an empty string in return.

I’m attaching an example of my rsyslog config file, I’m using ‘HOME’ env variable as an example.


set $  .my_home=getenv("HOME");  template(name="json-template"   type="list") {     constant(value="{")       constant(value="\",\"my_home\":\"")     property(name="$  .my_home")       constant(value="\",\"message\":\"")     property(name="msg" format="json")     constant(value="\"}\n") }  *.* action(type="omfile" dirCreateMode="0700" FileCreateMode="0644"        template="json-template" File="/var/log/my_log") 


{"my_home":"","message":"my log message"} 

rsyslogd: version 8.4.2

Mac Mojave 10.14 how to add permanent environment variable

I have been scouring the internet, and cannot seem to find a solution to permanently adding an environment variable, specifically when my OS is macOS Mojave (10.14). It seems there are a lot of tutorials for past versions of the OS, but none for this one one. It also seems every old method has become outdated.

I want to add an environment variable ENV_VAR=12345 to my Mac, so that I can import it into a Python module using os.environ['ENV_VAR']

The most relevant tutorial I have found is this, but it doesn’t quite do the trick for me. A lot of others tell you how to temporarily add environment variables to bash, but I don’t think this is good enough. I want the addition to be there if you restart terminal.

Can you please either provide a short tutorial or point me to the correct/modern tutorial?

Setting up environment variable for checker framework

I want to use checker framework for java and I am setting environment variable for it but when I am checking version of it in PowerShell in windows. It is showing that it is not able to access checker framework.

java -Xbootclasspath/p:%CHECKERS%/binary/jsr308-all.jar -jar %CHECKERS%/binary/jsr308-all.jar -version 

Here is the error

Error: Unable to access jarfile %CHECKERS%/binary/jsr308-all.jar

I have unzipped the downloaded file in C drive. And for the environment variable here is the paths that i have tried.

  • 1


  • 2


  • 3


  • 4