Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to automatically add a new path to the $PATH variable each time when my RPM package is installed.

I tried to use a post-installation script in the my RPM. Here is the part of RPM spec file containing this post installation script:

export PATH

But after successful installation the $PATH doesn't changed. Please help me with that issue.

share|improve this question

When you're adding the path in the RPM's post-script, it is only being set for the duration of the installation shell.

Within your RPM, you want to install a file under /etc/profile.d/.

# cat /etc/profile.d/

export PATH

If you're using CSH, the file should be named custom.csh.

share|improve this answer

Just add a soft link to the bin path instead of changing an environment variable:

%install ln -s /usr/app/mdg/bin/your-program /usr/bin your-program

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.