standardized conclusion required for rpm upgrade p

2019-07-25 03:41发布

问题:

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:

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}