If a package is installed using yum localinstall like this:
yum -y localinstall --nogpgcheck some-package-1.0.0.rpm
And now, if I try to run:
yum -y localinstall --nogpgcheck some-package-2.0.0.rpm
Will it replace the entire old version with the new one or does it maintain both the versions?
In RHEL 6 and later, yum install accepts both package names and local filenames, so localinstall is no longer necesary, but it's included for backward compatibility. In RHEL 8, dnf localinstall is simply an alias for dnf install .
yum localinstall package_name – yum searches the package in the working directory of terminal ( which is your /home by default ) and solves the dependencies and downloads dependencies and install them.
localinstall. Is used to install a set of local rpm files. If required the enabled repositories will be used to resolve dependencies. Note that the install command will do a local install, if given a file name.
Answer is, it depends on how some-package is packaged. In general, most of the .rpms packaged with foo-version-release.rpm gets obsoleted by the same package foo with version++ and/or release++.
Looking at your some-package, if you would run yum localinstall some-package-2.0.0.rpm (note, not with -y), then you would see message from yum, something like this:
Resolving Dependencies
--> Running transaction check
---> Package foo.x86_64 0:1.0.0 will be updated
---> Package foo.x86_64 0:2.0.0 will be an update
This tells that yum is going to update the package and remove the old one. yum resolves these dependencies whereas a rpm -ivh won't do it.
Now, there are special cases, e.g., kernel where it will be installed on the system side-by-side with the old one, unless you manual invoked a rpm -Uvh kernel*.rpm command.
Equivalent command to the yum localinstall would be two-fold,
# This will fail if some-2.0.0 is designed to obsolete some-1.0.0
$ rpm -ivh --test some-2.0.0.rpm  
whereas following would succeed:
$ rpm -Uvh --test some-2.0.0.rpm  
Note, I am using --test to do a dry-run. One needs to remove it for a real installation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With