I have installed a package from .rpm file and it is stored in /opt.
After some configuration I found that I need to reinstall the software. So I deleted the directory and attempted to reinstall the file with rpm -i XXX.rpm
. But it tells me that package xxx is already installed
.
How can I reinstall it?
0 there's --reinstall option. From man rpm : rpm {--reinstall} [install-options] PACKAGE_FILE ... This reinstalls a previously installed package.
The --force option will reinstall already installed packages or overwrite already installed files from other packages. You don't want this normally. If you tell rpm to install all RPMs from some directory, then it does exactly this. rpm will not ignore RPMs listed for installation.
Use the command yum localinstall /path/to/file. rpm . This command will install the local rpm file as well as searching for required rpms (dependencies, etc) on RHN or other repositories that are configured and install it for the user.
Try: rpm -iv --replacepkgs <packagefile>
.
More details are in the book.
You could also hit:
rpm -ivh --force [yourpackage.rpm]
which safely overwrites the old installed package with the desired new package. Furthermore, if you wish to install and upgrade simultaneously, then this next option:
rpm -Uvh [yourpackage.rpm]
will enable you to install including any upgrade simultaneously.
Another extra tip: You may face an error situation where an upgrade depends on another which in turn depends on another and inturn also depend on the one you want to install thus causing a "dependency upgrade loop". To avoid that hit:
rpm -Uvh --nodeps [yourpackage.rpm].
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