Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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

2 Answers 2

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.