Вопрос

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?

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top