-1

Need help with rpm. I need to replace (for example) pkg-number-one with pkg-number-two. Provides in spec: pkg-number. How can I do replace one installed pkg with another? Or I must change something to do this?

  • you should be more clear; what are the exact names of your packages; what are their version numbers? is "number-two" part of the name or the version number? – Chris Maes Jun 01 '16 at 12:05
  • @ChrisMaes There are pkg's names: product-name-default-1.2.3-1.el6.x86_64.rpm and product-name-another-1.2.3-1.el6.x86_64.rpm, and provides ins spec set to product-name. I hope it is more clear. – Denis Shipilov Jun 01 '16 at 19:26

2 Answers2

1

tl;dr version:

Provides: oldpackagename = some.version
Obsoletes: oldpackagename < some.version

But you should read the full guidelines. See:

https://fedoraproject.org/wiki/Packaging:Guidelines?rd=Packaging/Guidelines#Renaming.2FReplacing_Existing_Packages

for general guidelines. And:

https://fedoraproject.org/wiki/Upgrade_paths_%E2%80%94_renaming_or_splitting_packages

for special cases as many-to-one and many-to-many replacements.

msuchy
  • 5,162
  • 1
  • 14
  • 26
1

There was my case in fact:

Name:           some-pkg-%{VENDOR}
...
...
...
Provides:       some-pkg

%if "%{VENDOR}" != "default"
Conflicts:      some-pkg-default
Obsoletes:      some-pkg-default
%endif

In this way I can replace some-pkg-default with some-pkg-%{VENDOR} by "rpm -U ..."

But I can't roll back to some-pkg-default after that. If anyone knows how to do that - I will be glad to see resolution.

Anyway, it is not so important, because the rollback was not originally envisaged in this case...