4

I am working with RPM package manager for about a month now. Currently I want to use rpm -U to upgrade already existing content from previous RPM execution but I need to know the rpm package location on the file system.

The only way I can think of is searching whole file system for rpm name in %pre script but I would really like to avoid that option. Is there any way to get the path of the rpm package (package can be anywhere on the system) as a variable inside the spec file (%pre and %post script). Hope I explained my issue clearly enough.

Any help or proposal is welcome.

even2be
  • 415
  • 1
  • 3
  • 7
  • 2
    What are you trying to do exactly here? Why do you want this information? Are the files in question not packaged files? – Etan Reisner Jul 16 '14 at 14:13

1 Answers1

0

There isn't one location (or path) where a package is installed, so I'm not sure what you are asking.

The files that are installed by a installed rpm package called "foo" can be displayed with rpm -ql foo There is no common prefix on the paths except "/" in general.

Jeff Johnson
  • 2,310
  • 13
  • 23