rpm -ivh vs. rpm -Uvh
Im wondering if someone could explain to me when I should use each of these different commands to install new RPMs. I have read some places that use -ivh, and some that use -Uvh, but I am not sure how to determine on my own which should be used at what time.
|
Excellent question... I have the same one, actually. They both seem to work the same...
|
I use rpm -Uvh < package.rpm> myself. The U gets rid of old stuff but other than that, it's mostly just personal preference. :)
This is from ( man rpm ) rpm {-U|--upgrade} [install-options] PACKAGE_FILE ... This upgrades or installs the package currently installed to a newer version. This is the same as install, except all other version(s) of the package are removed after the new package is installed. |
-U is used for upgrade, and -i is used for install. I recommend using -i for installing AND upgrading whenever possible since -U will overwrite certian config files depending on whoever packaged the rpm.
|
You can use
Code:
rpm -Uhv package.rpm Code:
rpm -ihv package.rpm |
Update and install are different
Update (-U) is different install (-i) if the package was previously installed: especially if some of the files have been modified. Update will attempt to preserve your modifications, whereas install will remove all traces of any modifications you might have made.
If the current contents of the file is different from both that what was originally installed and what is in the update package, and the file in the update package is also different from that originally installed, the current contents are saved to a file with .rpmsave extension before replacing it with the file from the update package. If there was no file in the originally installed package, the current file is renamed with the .rpmorig extension before replacing it with the file from the update package. If using update, you are responsible for manually processing any .rpmsave or .rpmorig files that are created. This handling of modifications is in addition to the other difference: update removes the old package (if there was one), but install does not (requiring manual use of uninstall (-e) if you want to get rid of the other versions). |
hoylen
i take it you are not aware that this thread is from 2004 ( 9 years ago ) Also on Fedora yum should be used use rpm as a last resort and for a few specific things like "Libre Office 4" but even then using -localinstall option in yum is preferred |
All times are GMT -5. The time now is 10:29 PM. |