RPM packages does not contains incremental updates (as contrary to e.g. Solaris). So every package contains everything needed for both upgrade and clean install.
When you call
yum install firefox
firefox is already installed then yum should refuse to proceed even when there is newer version available. You should call:
yum upgrade firefox
This will install new version of the package, and them remove the old package automatically. So no left over should remain on your system.
Though you can call:
yum install http://foo.bar/firefox-40-1.rpm
and if it is newer then currently installed package, then yum automatically convert it to
yum upgrade command.
And there is one other exception – kernel.
yum install kernel
will install new kernel (when available), but will not remove the old one (so you can boot to old one, if the new one does not work). In fact it apply on few other packages too. I will quote from
man page of
installonlypkgs List of package provides that should only ever be
installed, never updated. Kernels in particular fall into this cat-
egory. Defaults to kernel, kernel-bigmem, kernel-enterprise, kernel-smp, kernel-modules, kernel-debug,
source, kernel-devel, kernel-PAE, kernel-PAE-debug.
Note that because these are provides, and not just package names, kernel-devel will also apply to kernel-debug-devel,
installonly_limit Number of packages listed in
installonlypkgs to keep installed at the same time. Setting to 0
disables this feature.
Default is '3'. Note that this functionality used to be in the "installonlyn" plugin, where this option was altered via
that as of version 3.2.24, yum will now look in the yumdb for a installonly attribute on installed packages. If that
"keep", then they will never be removed.
So you can have up to 3 kernel packages installed concurrently. But not 4 as yum will start removing them automatically. As you stated – you can remove old kernels by
package-cleanup --oldkernels if you really want to.
There is no need to do anything similar for normal packages as yum do that every time during
You can verify it by running:
rpm -q kernel
which will likely list 3 package. While
rpm -q httpd
Should list only one package. And
rpm -q glibc
will likely list 2 packages on 64bit machine – one
x86_64 and other
i686 if you have some packages which requires