开发者

How to reinstall rpm package?

开发者 https://www.devze.com 2023-03-08 16:27 出处:网络
I have installed a package from .rpm file and it is stor开发者_StackOverflow中文版ed in /opt. After some configuration I found that I need to reinstall the software.So I deleted the directory and att

I have installed a package from .rpm file and it is stor开发者_StackOverflow中文版ed 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?


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


Starting with version 4.12.0 there's --reinstall option.

From RPM 4.12.0 Release Notes:

New --reinstall mode which can handle changing file policies (RhBug:966715)

From man rpm:

rpm {--reinstall} [install-options] PACKAGE_FILE ...

This reinstalls a previously installed package.


You got to uninstall the software's rpm:

rpm -e XXX.rpm

Then install it :

rpm -i XXX.rpm

Next time whenever you are not sure about the software being already there on the machine, always check using:

rpm -qa |grep XXX 

where XXX is the software name or part of the name. This will give you the version already present on the machine.

0

精彩评论

暂无评论...
验证码 换一张
取 消