On RHEL 7.2 I have installed an rpm with the command

# rpm -ivh --relocate /some/default/prefix=/some/custom/prefix example-1.rpm

Now I want to upgrade example.rpm to version 2 and make sure that the same prefix is used. Is this handled by simply typing:

# rpm -U example-2.rpm

Or where will the files end up if using the second command to upgrade the rpm? Do I need to specify the prefix again when upgrading, i.e.

# rpm -U --relocate /some/default/prefix=/some/custom/prefix example-2.rpm

And secondly, can yum be used to achieve this?

1 Answer 1


If the command # rpm -U example-2.rpm is used, the rpm will simply be installed on the paths specified in the rpm-spec. i.e. any previous installation with --relocate is ignored.

To my knowledge there is no way to ensure that the same prefixes are used other than simply documenting what prefixes were used during the initial installation of the rpm and then use them again when upgrading the rpm (assuming that there is still support for them in the new version of the rpm).

i.e. something like this:

Initial installation

# rpm -ivh --relocate /some/default/prefix=/some/custom/prefix example-1.rpm

Upgrade of rpm

# rpm -Uvh --relocate /some/default/prefix=/some/custom/prefix example-2.rpm

You must log in to answer this question.

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