LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (http://www.linuxquestions.org/questions/fedora-35/)
-   -   rpm -ivh vs. rpm -Uvh (http://www.linuxquestions.org/questions/fedora-35/rpm-ivh-vs-rpm-uvh-256231/)

Eklipz 11-17-2004 09:17 PM

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.

noxious 11-17-2004 09:28 PM

Excellent question... I have the same one, actually. They both seem to work the same...

homey 11-17-2004 09:35 PM

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.

{-_-} 11-18-2004 12:45 AM

-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.

Boby 11-18-2004 03:27 AM

You can use
Code:

rpm -Uhv package.rpm
for installing too. If it doesn't find an older package on your system it will just install it like
Code:

rpm -ihv package.rpm
Boby

hoylen 12-01-2013 10:21 PM

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).

John VV 12-02-2013 01:51 AM

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 05:45 PM.