Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Is there a way to add and remove packages at the same time with a single yum command? For example, installing postfix and removing sendmail without running two separate commands/transactions.

share|improve this question
    
Not to my knowledge, but I'm not a daily yum user. Why do you want it in a single command? –  jippie Jun 2 '12 at 16:39
    
@jippie Convenience, mostly. And reducing the time to set up multiple transactions. –  Michael Ekstrand Jun 2 '12 at 16:43
add comment

2 Answers

up vote 8 down vote accepted

Yes. Invoking yum shell will allow you to specify multiple commands that will happen simultaneously when run is entered.

share|improve this answer
1  
Awesome, this is exactly what I was looking for. –  Michael Ekstrand Jun 2 '12 at 20:01
    
I had originally been using Python for this. I've now cut my script down to about 20% the size by using BASH! –  quickshiftin Mar 17 at 18:38
add comment

Newer versions of yum also have the swap command:

# yum swap -- install foo -- remove bar
share|improve this answer
add comment

Your Answer

 
discard

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.