Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Can someone please help me understand the rpm command. From the rpm man pages:

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.

My understanding is that if I indicate a PACKAGE_FILE that is an upgrade of something I already have installed, it will replace the files... upgrading the package.

Specifically I am trying to upgrade VirtualBox on a Fedora 14 OS. I am running the following command:

rpm -Uvh VirtualBox-4.1-4.1.4_74291_fedora14-1.x86_64.rpm

and am getting (many) errors saying there is an older version of the file

... <similar output omitted>

file /bla/virtualbox/bla/powernotification-r0drv.c from install of
   VirtualBox-4.1-4.1.4_74291_fedora14-1.x86_64 conflicts with file from 
   package VirtualBox-4.0-4.0.12_72916_fedora14-1.x86_64

... </similar output omitted>

I am obviously not understanding something here. Can anyone shed some light on this?

share|improve this question
1  
Are you using the Fedora supplied RPM's or using something compiled by the VBox team? I'll leave this to a Fedora expert to answer but this usually happens when either the original rpm was installed multiple times and the installed file database has duplicate entries or the package isn't compiled correctly (sometimes a name mis-match) and doesn't understand that it is a new version of an existing package. You might need to either repair your RPM database, use a different package, or force the issue with --replace-files or uninstalling/installing. –  Caleb Oct 30 '11 at 21:46
    
I'll look into your suggestion... Thank you Caleb. –  Hari Seldon Oct 30 '11 at 21:52
add comment

2 Answers 2

up vote 1 down vote accepted

-U can only upgrade packages with the same name, and the two packages have different names. One is called VirtualBox-4.0, and the other is called VirtualBox-4.1.

VirtualBox-4.0-4.0.12_72916_fedora14-1       .x86_64
^name          ^version              ^release ^arch
share|improve this answer
    
How do you suggest upgrading that package? I may be wrong, but it seems pretty standard practice to name the packages according to their revision numbers as upgrades are released, so surely this is something that can be accommodated in some way –  Hari Seldon Oct 30 '11 at 21:57
1  
No. RPM is not meant to be used this way. You will need to remove the old package before you can install the new. You may be able to use yum to perform both in the same transaction, but this cannot be done with rpm alone. –  Ignacio Vazquez-Abrams Oct 30 '11 at 22:07
    
I appreciate the information... I am still learning to "think in linux"... there is alot to learn :) –  Hari Seldon Oct 30 '11 at 22:13
    
And third parties that pull this sort of stunt only make it harder. –  Ignacio Vazquez-Abrams Oct 30 '11 at 22:15
    
Wrong. The package name is VirtualBox, so there is no mismatch there. The error messages are really informative, though: The installation would replace a file that is needed for some other package (or belongs to another package). Often happens when RPMs are carelessly slapped together by third parties. –  vonbrand Jan 23 '13 at 14:02
show 3 more comments

RPM is one package only, i.e. your command installs just the VirtualBox package. If the new version depends on updated versions of other stuff, the command will fail (obviously).

You might try "yum localinstall VirtualBox-..." (yum does first resolve dependencies, and gets whatever is needed). This might fail too, if the new version requires updates, and some existing stuff does depend on the updates (and no newer versions are available).

share|improve this answer
add comment

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.