1
votes

The rpm command provides three main operations for upgrading and installing packages: Upgrade An upgrade operation means installing a new version of a package and removing all previous versions of the same package. If you have not installed a package previously, the upgrade operation will install the package. Freshen A freshen operation means to install a new version of a package only if you have already installed another version of the package. Install An install operation installs a package for the first time. It also, through special command-line parameters, allows you to install multiple versions of a package, usually not what we want. So, in the vast majority of cases, you want to run the upgrade operation for all package installations.

Should normally install packages with rpm -U, not rpm -i. One of the main reasons is that rpm -i allows you to install multiple instances of the same (identical) package.

  1. Is this the standard conclusion or
  2. should I stop installing the second instance of the package along with the first instance by writing any wrapper script or by adding code in spec file section.

If 2 point is the answer how can achieve this. Please guide me about this confusion.

1
This is not clear at all. What do you want to know exactly? - fge
i want to achieve this -- when user tries to install the newer version of same package i want to throw the error that u already have oledr version of this package installed please use upgrade option to upgrade it. there should not be multiple installation of same pkg with different versions in the system. Please tell me how to acahiev this - user1234

1 Answers

1
votes

Assuming you only every want one version of an RPM installed at once, then yes use "rpm -U".

Creating an RPM that can have multiple versions installed requires that all common files between the versions are identical. This frequently happens, so you may get this behaviour "by default".

You can also prevent multiple versions with the following in you spec:

Conflicts : %{name} < %{version}