LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-13-2011, 02:34 AM   #1
sr164w
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Rep: Reputation: Disabled
File conflict with the old installed rpm package while installing new package


when I am trying to install my rpm application package (2.5-0.1.12 -- Version and revision) If any older version is installed I am getting below file conflict error.

file /opt/compname/product/application.jar from install of comp-prod-2.2-0.1.12 conflicts with file from package comp-prod-2.5-0.1.12

I am getting the above error for jar file and desktop file between older and newer versions.

But when i use update command its overwriting the older version and installing new.

Should i do anything to resolve this in my spec file.

Please tell me why this conflict is coming and how to resolve this?
 
Old 12-13-2011, 04:32 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Quote:
Originally Posted by sr164w View Post
when I am trying to install my rpm application package (2.5-0.1.12 -- Version and revision) If any older version is installed I am getting below file conflict error. file /opt/compname/product/application.jar from install of comp-prod-2.2-0.1.12 conflicts with file from package comp-prod-2.5-0.1.12
I am getting the above error for jar file and desktop file between older and newer versions.
This is expected and wanted behaviour: of package %{name} one usually does not install a second %{version} on the same machine.


Quote:
Originally Posted by sr164w View Post
But when i use update command its overwriting the older version and installing new. Should i do anything to resolve this in my spec file.
This is expected and wanted behaviour as well. Even if some package contents don't change it'll install files anew. The only exception are configuration files which may be protected with the "noreplace" option.
* BTW your version numbering seems odd. Sure you can build and ship a new %{minor} version (on upstream release?) but (especially when patching) the %{build} should start at the lowest incremented number like -0.0.1 and not 12. For example 2.2-0.1.12 leads to 2.2-0.1.13 if patched or to 2.5-0.1.1 if upstream updates it.
 
Old 12-13-2011, 11:13 PM   #3
sr164w
LQ Newbie
 
Registered: Dec 2011
Posts: 5

Original Poster
Rep: Reputation: Disabled
installer upgrade using RPM

RPM is taking care of installing older version and also same version scenario.

If I do update instead of installing new version when old is existing then it updates the package so no problem here.

But When I try to install a new version when an older version exists RPM installs the new version separately thus two versions will exist.

I would like to stop the new version installation when an older exists in my spec file by checking in %pre section. How can I know that rpm -ivh is called or rpm -Uvh is called in my spec file?

if [ "$1" = "1" ]; then
echo Perform tasks to prepare for the initial installation
elif [ "$1" = "2" ]; then
echo You already have old version Please use -U to upgrade.
fi

"$1" = "2" true for both new installation when old is present and for upgrade.

Please let me know how to solve this.
 
Old 12-15-2011, 11:43 AM   #4
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,353
Blog Entries: 55

Rep: Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541Reputation: 3541
Quote:
Originally Posted by sr164w View Post
I would like to stop the new version installation when an older exists in my spec file by checking in %pre section.
Doesn't make sense as I already told you how RPM prohibits you from doing that, besides you already created another follow-up thread here: http://www.linuxquestions.org/questi...rocess-918662/ where' you've gotten the same answer. * And please note the suggestion in the first reply of using --force rpm never is a proper solution.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
list installed package files and how to know which package a file belongs bujecas Slackware 3 01-09-2010 03:14 PM
Ignoring package conflict in RPM spec file rockfx01 Programming 0 08-13-2008 11:49 AM
RPM package db file conflict gmabrito Linux - General 10 03-22-2008 07:03 AM
RPM package manager says package needs to be installed. But I already installed it! nick623 Linux - Software 2 05-24-2005 02:15 AM
RPM Package Conflict Error Wicksy Linux - General 5 09-09-2003 11:26 AM


All times are GMT -5. The time now is 12:07 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration