PDA

View Full Version : rpm --relocate Issue ?


anishnath
27th July 2011, 06:25 PM
rpm -qi shows wrong Relocations

--------------------------------------------------------------------------------

rpm -ihv Test-01.rpm --relocate /opt/Test01=/opt/Test02
issue command
rpm -ql Test-01
it shows the file from /opt/Test02 that is correct
but when i query
rpm -qi Test-01
Name : Test-01 Relocations: /opt/Test01

it shows the old Relocation

Any Idea why

---------- Post added at 05:25 PM ---------- Previous post was at 04:15 PM ----------

Description of problem:
rpm -qi shows wrong Relocation after installing the package using rpm --relocate option

Version-Release number of selected component (if applicable):


How reproducible:
Build a spec file using Prefix option

example rpm:- Test-01.rpm

Steps to Reproduce:
1. rpm -ihv Test-01.rpm --relocate /opt/Test01=/opt/Test02
2.
3.

Actual results:
rpm -qi Test-01
Name : Test-01 Relocations: /opt/Test01

Expected results:
rpm -qi Test-01
Name : Test-01 Relocations: /opt/Test02

flyingfsck
27th July 2011, 06:27 PM
Because it queries the package database, which hasn't changed. You have to rebuild the rpm for that to change.

What do you find when you look at the install place with ls or whereis - did it install to the right place?

anishnath
27th July 2011, 06:30 PM

Insatll go to the right place what i specify on --relocate option
rebuild the rpm for that to change how ? do u have some example or which option i need to use

flyingfsck
27th July 2011, 06:37 PM
There is a package called 'rpmbuild' that you have to install and the command has the same name. You got to read the man page. You of course also need the Source RPM, not the the binary. It is quite simple, but it has been a while since I did something like that.

anishnath
28th July 2011, 05:04 AM
%define version 1
%define release 20
Version: 1
Release: 1
Summary: TESt
Name: Test-01
License: Copyright Test-01
Group: Applications/System
Distribution: Test-01
Vendor: Test-01
Prefix: /opt/Test-01

%description
Test-01

%prep

%build

%install

%clean

%post


This is my spec file

using rpmbuild -bb option to create the rpm binary distribution getting the same issue Any idea

flyingfsck
28th July 2011, 06:57 AM
Did you change the 'prefix' path in the spec file?

anishnath
28th July 2011, 08:56 AM
default Prefix: /opt/Test-01
this i'm overriding using --relocate option
rpm -ihv Test-01.rpm --relocate /opt/Test01=/opt/Test02

ls -l /opt/Test02
(3 files)

rpm -qi Test-01
[OUtput] Name : Test-01 Relocation: /opt/Test01


still it's pointing to /opt/Test01 and not changing to /opt/Test02