0

Im having trouble on a CentOS 8 VM. for some reason whenever we reboot the VM it gives us the

bash: sed: command not found

for most basic commands such as ls for example. We figured out that the PATH environment variable was not being written for some reason and had to manually add it with

PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

but whenver we restart the VM the same issue occurs again.

Im not really experienced with the linux os; so if someone could just guide me on how to debug this issue?

I tried stoping the cronjobs that might be clearing the environment (even tho none were doing so). Also we tried the

source /etc/profile.d/profile

but that didn't seem to do work ...

Thank you,

1 Answer 1

0

The PATH environment variable is defined in /etc/rc.d/init.d/functions as following:

# Set up a default search path.
PATH="/sbin:/usr/sbin:/bin:/usr/bin"
export PATH

It can be appended by more directories using the /root/.bash_profile, assuming you're using bash as default shell, like this example:

PATH=$PATH:$HOME/bin:/opt/mybin

export PATH

Have you tried this method ?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .