9

I am getting install failure due to file conflicts. I am facing this issue only on Red Hat Linux 7. Same spec file works on Ubuntu and other Linux distributions.

I tried putting echo on %pre, %post, %preun and %postun sections but I never reached those messages. I tried %dump at the beginning of spec file which also didn't print anything. How do I trace the spec file execution?

%files %defattr(-,root,root,-) @CPACK_PACKAGING_INSTALL_PREFIX@/sbin/MyExe @CPACK_PACKAGING_INSTALL_PREFIX@/share/doc/@CPACK_PACKAGE_FILE_NAME@/myconf.conf @CPACK_PACKAGING_INSTALL_PREFIX@/share/doc/@CPACK_PACKAGE_FILE_NAME@/README %if @IS_RHEL7@ /etc/systemd/system/myoverride.conf %endif 

Error during install:

Preparing packages... file /etc/systemd/system/myoverride.conf from install of mypackage-5.0.1.x86_64 conflicts with file from package mypackage-4.11.1.x86_64 file /usr/sbin/myexe from install of mypackage-5.0.1.x86_64 conflicts with file from package mypackage-4.11.1.x86_64 
2
  • What method of installation are you using? I mean rpm or yum? Commented Nov 17, 2017 at 5:11
  • I am using rpm, I do not want to use -U option for upgrade or --force or --replaceFiles etc. I want it to handle the upgrade itself. Commented Nov 17, 2017 at 6:05

1 Answer 1

20

you cannot install twice the same rpm. Therefore if you want to install a newer version of the same rpm (mypackage in your case); you need to use the -U | --upgrade option. Typical usage of rpm goes like this:

rpm -Uvh mypackage-<new-version>.rpm 
  • -U : upgrade mypackage to this version
  • -vh : nice display of progress.
2
  • Both rpms have different version of the config and installer, they include changes in configuration file and exe. I need to upgrade both with this install. Commented Nov 20, 2017 at 1:36
  • 2
    If you want to install both rpms you'll need to rename one of them because you cannot install two rpms with the same name Commented Nov 20, 2017 at 6:10

You must log in to answer this question.