FedoraForum.org - Fedora Support Forums and Community
Results 1 to 6 of 6
  1. #1
    Join Date
    Sep 2017
    Location
    Aveiro
    Posts
    4

    Update RPM conflict

    Hi all.
    I've created an rpm and installed that rpm on my system without any problems. After that I've decided to create a new version of the same RPM. However, when updating I get a conflict during the update:

    Transaction check error:
    file /opt/automation/ffwk/inventory/discovery from install of ffwk-automation-1.1.0-r66.el7.noarch conflicts with file from package ffwk-automation-1.1.0-r47.xxx.el7.noarch


    The conflict appears to be that the previous RPM distributed a directory called "/opt/automation/ffwk/inventory/discovery" and in the new version that directory has been removed and a file is distributed exactly in the same place, i.e.: /opt/automation/ffwk/inventory/discovery

    Can't we replace a directory with a file with same name exactly on the same location? Am I missing something?

    Any help would be appreciated.
    Thanks.
    Rui

  2. #2
    Join Date
    Oct 2011
    Posts
    1,610

    Re: Update RPM conflict

    Is the older package version owning that directory?

  3. #3
    Join Date
    Sep 2017
    Location
    Aveiro
    Posts
    4

    Re: Update RPM conflict

    Yes.
    directory /opt/automation/ffwk/inventory/discovery was created by the old package. Uninstalling the old package that directory is removed.

  4. #4
    Join Date
    Sep 2017
    Location
    Aveiro
    Posts
    4

    Re: Update RPM conflict

    I think yum rpm does not support replacing a directory with a file with the same name. Here's a striped demo of the "problem".

    Code:
    Name:     hello
    Version:  2.10
    Release:  1
    Summary:  The "Hello World" program from GNU
    License:  GPLv3+
    
    %description
    The "Hello World" program, done with all bells and whistles of a proper FOSS
    project, including configuration, build, internationalization, help files, etc.
    
    
    %install
    mkdir -p %{buildroot}/opt/sample
    
    %files
    /opt/sample
    Create the rpm and install.
    After installing the rpm, create a new version... replacing the directory /opt/sample witrh a file.
    Code:
    Name:     hello
    Version:  2.11
    Release:  1
    Summary:  The "Hello World" program from GNU
    License:  GPLv3+
    Source0: sample
    
    %description
    The "Hello World" program, done with all bells and whistles of a proper FOSS 
    project, including configuration, build, internationalization, help files, etc.
    
    
    %install
    mkdir -p %{buildroot}/opt
    cp %{SOURCE0} %{buildroot}/opt
    
    %files
    /opt/sample
    Build the new version of the RPM and try to update the previously installed rpm and you'll get an error:
    Error: Transaction check error:
    file /opt/sample from install of hello-2.11-1.x86_64 conflicts with file from package hello-2.10-1.x86_64


    Unless I'm missing something, what I'm trying to do does not work :-/

    Thanks.
    Rui

  5. #5
    Join Date
    Oct 2011
    Posts
    1,610

    Re: Update RPM conflict

    I see what you mean, this seems to be a limitation to RPM. See https://fedoraproject.org/wiki/Packa...ry_Replacement for more info.

    There is also a workaround included in previous link, following works:

    Code:
    Name:     directoryovewrite
    Version:  2.11
    Release:  1
    Summary:  The "Hello World" program from GNU
    License:  GPLv3+
    
    %description
    The "Hello World" program, done with all bells and whistles of a proper FOSS
    project, including configuration, build, internationalization, help files, etc.
    
    
    %install
    mkdir -p %{buildroot}/opt
    touch %{buildroot}/opt/sample
    
    %pretrans -p <lua>
    -- Define the path to directory being replaced below.
    -- DO NOT add a trailing slash at the end.
    path = "/opt/sample"
    st = posix.stat(path)
    if st and st.type == "directory" then
      status = os.rename(path, path .. ".rpmmoved")
      if not status then
        suffix = 0
        while not status do
          suffix = suffix + 1
          status = os.rename(path .. ".rpmmoved", path .. ".rpmmoved." .. suffix)
        end
        os.rename(path, path .. ".rpmmoved")
      end
    end
    
    %files
    /opt/sample

  6. #6
    Join Date
    Sep 2017
    Location
    Aveiro
    Posts
    4

    Re: Update RPM conflict

    Many thanks for the pointer.

    Didn't know it was a documented limitation.

Similar Threads

  1. update conflict
    By hadiono in forum Using Fedora
    Replies: 2
    Last Post: 15th September 2015, 06:49 AM
  2. Yum update conflict
    By Hewjr100 in forum F-20 Development Forum
    Replies: 4
    Last Post: 30th September 2013, 11:17 PM
  3. Update Conflict
    By superbnerd in forum Using Fedora
    Replies: 14
    Last Post: 16th September 2004, 07:48 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •