Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reinstall rpm package?

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?

like image 200
Newbie Avatar asked May 25 '11 04:05

Newbie


People also ask

How do I reinstall RPM using RPM?

0 there's --reinstall option. From man rpm : rpm {--reinstall} [install-options] PACKAGE_FILE ... This reinstalls a previously installed package.

How do I force an RPM to install?

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.

How do I install an RPM package locally?

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.


2 Answers

Try: rpm -iv --replacepkgs <packagefile>.

More details are in the book.

like image 179
sarnold Avatar answered Sep 25 '22 00:09

sarnold


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]. 
like image 44
Laenka-Oss Avatar answered Sep 26 '22 00:09

Laenka-Oss