Q on RPM, conditional install or removal, like installf, removef


 
Thread Tools Search this Thread
Operating Systems Linux Q on RPM, conditional install or removal, like installf, removef
# 1  
Old 05-20-2015
Question Q on RPM, conditional install or removal, like installf, removef

I am creating binary RPM on RedHat 6 and would like to do this:

at install time, depending on situation, install a file or not install it

For comparison, I do this on solaris using "installf",
is there a way of achieving similar functionality in RPM?

And conversely for conditional removal (like "removef" on solaris)
# 2  
Old 05-20-2015
That's done with dependencies -- depending on a certain package to make sure a certain file's available, etc.
# 3  
Old 05-20-2015
Are you talking about the Require: packagename of a specfile? (also available: BuildRequires)
Which basicly is the same like what Corona said.

hth
# 4  
Old 05-20-2015
No, I am not talking about package dependencies.

It's like this, in the post install pseudo-code

first part of post install script
if [ some condition ] ; then
install /opt/dir/file
end if
rest of post install script

IOW, if "some condition" is true then /opt/dir/file becomes part of the installed package, otherwise not.
# 5  
Old 05-20-2015
That sounds like data files, which are the sort of thing a package manager doesn't generally remove on uninstall, or strictly consider part of its set of installed files.

RPM does turn out to have pre/post install scripts though.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

INSTALL RPM's IN RHEL 5.5

After checking the dependencies from below command:- yum deplist gcc Update:- Now when I tried to install the very first dependency , it gave the below error, I guess something is wrong with YUM server itself :P ... (1 Reply)
Discussion started by: manish131081
1 Replies

2. Fedora

Install RPM package after OS Installation

Hi Guys I want to know whether is it possible to automatically Install a RPM package after installing OS. Basically we have have one rpm package which we want to install as part of OS installation . Please Suggest (3 Replies)
Discussion started by: mr_deb
3 Replies

3. Shell Programming and Scripting

any savant ? using AWK/SED to remove newline character between two strings : conditional removal

I'd like to remove (do a pattern or precise replacement - this I can handle in SED using Regex ) ---AFTER THE 1ST Occurrence ( i.e. on the 2nd occurrence - from the 2nd to fourth occurance ) of a specific string : type 1 -- After the 1st occurrence of 1 string1 till the 1st occurrence of... (4 Replies)
Discussion started by: sieger007
4 Replies

4. Red Hat

RPM Updation & Keeping User Change files during removal

Hi All, I have a RPM for an Java based application. Currently it works fine. But recently I want to implement that when newer packages gets installed over the older one, the rpm should only update the older files with the newer one (I know this could be done by rpm -Uvh xxx.rpm), but it... (0 Replies)
Discussion started by: jw_amp
0 Replies

5. Red Hat

RPM Installation & Removal issue

Hi, I created an RPM for one of our internal serer: tel-gw--2010.05.1.0-SNAPSHOT-1.rpm What happened I Installed for 5 times, and it get installed (/usr/tel-gw/) & added 5 entries into rpm db. And when I query RPM db as "rpm -qa | grep tel-gw--2010.05.1.0-SNAPSHOT-1", it shows 5 times in... (0 Replies)
Discussion started by: jw_amp
0 Replies

6. UNIX for Dummies Questions & Answers

RPM install problem

I'm trying to install mysql on a server, but I keep getting an error. Can anyone offer any help? Below I've listed a bunch of info that you might find helpful. Here are the commands I'm using. $ ls MySQL-client-community-5.1.35-0.rhel3.i386.rpm... (2 Replies)
Discussion started by: wsetchell
2 Replies

7. UNIX for Dummies Questions & Answers

RPM uninstall/install

Running FC5 on a Dell desktop. When I compile a LaTex file, it goes fine but only outlines blank boxes where figs should be. When I send the figs.eps and Tex file to a friend, his compiles and imbeds the fig. in the text of the DVI output using my files without add'nl control cards. I conclude... (1 Reply)
Discussion started by: blann
1 Replies

8. SuSE

How to install .src.rpm ? ( source rpm )

Hi, I have got few RPM's from rpmfind.net ( mainly gcc ). But it seems to be src files instead of the image. so I think we have to build the src files according to target machine using rpmbuild. Can any one help me with 1) Various options of rpm build that have to be taken care 2)... (3 Replies)
Discussion started by: Sivaswami
3 Replies

9. Shell Programming and Scripting

How to install expect rpm?

Hi , I am tryin to install expect rpm on my linux machine. I have the source file expect-5.42.1-1.src.rpm I am doin this rpm -ivh expect-5.42.1-1.src.rpm But I am gettin this error warning: expect-5.42.1-1.src.rpm: V3 DSA signature : NOKEY, key ID db42a60e error: cannot... (1 Reply)
Discussion started by: eamani_sun
1 Replies

10. UNIX for Dummies Questions & Answers

Solaris - Can it install RPM file?

Currently i just installed solaris 10 now i want to install a package in rpm format which i used to install in Linux can it install in Solaris 10 as well ? if yes,what is the command ? last time in linux i used to type this command #rpm -i xxxxx.rpm but i tried in linux it not... (3 Replies)
Discussion started by: bluefries
3 Replies
Login or Register to Ask a Question