Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm a *.deb guy and I feel quite uncomfortable while managing rpms.

I'm used to run apt-get upgrade in my debian based servers for "normal" upgrades and apt-get dist-upgrade for allowing kernel upgrades or allowing new major package versions upgrades.

In the CentOS servers I admin, I would like to have a similar feature, however man yum doesn't seem to offer such behaviour. And the differences between yum update and yum upgrade seems to be not what I'm looking for.

So far my best approach is to add and remove the following setting in /etc/yum.conf:

exclude=kernel*

It must be a better approach. Every suggestion will be welcome.

EDITED:

The yum man's page description of them and the --obsoletes flag is a bit cryptic for me. So let me reword what do I understand from it: Do I have to understand that yum update wont install a new kernel because it would mean marking as obsolete the current one? hence do I have to assume that yum upgrade does the same or almost the same than apt-get dist-upgrade?

EDITED 2

What I like best form apt-get upgrade is that it tells me which packages remain retained so I can act accordingly; either with apt-get dist-upgrade or with explicit apt-get install package

So after thinking a bit my best approach at this moment will be: disable the obsoletes setting in yum.conf (as described by Steven Pritchard in his answer) and run at first yum update and once all the updates are installed, run a second yum update --obsoletes to check which packages have been retained and act in function of its results.

Will that work?

share|improve this question
    
apt-get install package (corrected) –  hmontoliu Aug 6 '11 at 6:03

2 Answers 2

up vote 5 down vote accepted

yum update originally just did upgrades of packages to new versions. If, for example, foo-awesome obsoleted foo, yum update wouldn't offer to upgrade from foo to foo-awesome. Adding the --obsoletes flag to yum update made it do the extra checks to also offer that upgrade path. yum upgrade was added as (essentially) an alias for yum --obsoletes update. Since this is the behavior that almost everyone wants all of the time, the configuration option obsoletes=1 was added to the default /etc/yum.conf, making yum update and yum upgrade equivalent on any recent, stock, Fedora/RHEL/CentOS/etc.

If you want to avoid kernel updates when you're running yum update, you can just do yum --exclude=kernel* update. If you want automatic updates on, but you want to avoid automatic kernel upgrades, then adding the exclude to yum.conf is probably the right answer.

There probably isn't a Right Answer for your question. RHEL and RHEL-based distributions don't have the same philosophy as the Debian developers when it comes to updates, so the tools don't encourage the same sorts of behavior.

share|improve this answer
    
+1 Steven; I guess that there won't be a right answer, that's why I want as much feedback as possible. Your answer is excellent. Let me wait for other people approaches :-) –  hmontoliu Aug 5 '11 at 17:35
    
See my EDITED 2, so far I believe that is a good approach to mimic apt-get behavior. –  hmontoliu Aug 5 '11 at 17:50
    
You can also add excludes to the yum.conf file. –  Not Now Aug 5 '11 at 19:06

Try

# yum upgrade yum kernel
# yum -y upgrade
share|improve this answer

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.