Google Site SearchFN Site Search FN Blog Login FN Blog Login
Site Navigation:
 
 

All you have to know about RPM

by Alexandre de Abreu

How can I upgrade all my installed packages with one Freshen command?

You can upgrade RPMs with the Upgrade command showed on the first page of this article or you can use the "Freshen" option as I'll show here. Both ways can be used to upgrade files but there is one big difference between them, using the traditional "-Uvh" option RPM will upgrade an installed package, if the package is not installed it will be done so.

Thus, the command below will upgrade or install(if package does not exist on the system) the "new-package" package:

rpm -Uvh new-package.rpm

The Freshen command is used to upgrade only installed packages, so the same command used above with the Freshen option will be:

rpm -Fvh new-package.rpm

RPM package "new-package.rpm" will be installed only if an old version of this package was installed on the system. Please note that many problems can occur when upgrading existing packages. This command is often used for upgrading multiple packages at the same time. A bad example of that is when doing:

rpm -Fvh /fedora/updates/*.rpm

More problems...

Imagine that among the RPM files on /fedora/updates directory there are 2 files: glibc-2.3.2-101.4.i386.rpm and glibc-2.3.2-101.4.i686.rpm, same versions, looks like the same, but don't think this. Depending on your arch, only one package is really good for you. You can even have to reinstall the system if you use it wrong. The same can happen to other critical packages, see Kernel upgrade notes for more about that.

Another error can happen when upgrading multiple packages, imagine you got two packages with different versions but of the same program and these packages are used with the Freshen option as showed above. What will happen? RPM won't work correctly. So, what's the right way?

Solution:

When installing package upgrades don't pass them all as a parameter to RPM command. Organize your packages by arch(i386, i686, athlon, etc) and forget about multiple entries of the same file, choose one, usually the new one and simply remove the other. And don't forget to read the Test/Simulating option and Kernel upgrade notes.