1

I use a meta package to manage software and common dependencies across several lab systems, and until today, this has worked great. However, after a recent build every RPM spec file directive to copy files causes yum to throw a transaction check error when I try to install the built RPM.

Building/installing to CentOS 7.

RPM Spec file:

Name:           lab-meta
Url:            http://pkgs.local/EL/7
License:        GPL
Group:          User Interface/Desktops
Version:        1.8.1
Release:        2%{?dist}


Summary:        lab meta package
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Source2:    R-update.sh
Source3:    R_labSelectInstall-03.R
Source5:        lab-init.el
Source6:        texlive.sh
Source7:        jabref
Source8:        JabRef-4.3.1.jar
Source9:        JabRef.desktop
Source10:        JabRef_Icon.png
Source11:        yum-update-nightly

Requires:       R, emacs, emacs-ess, texlive-datetime, texlive-ifthenx
Requires:   texlive-relsize, texlive-graphbox
Requires:   jags4, jags4-devel, jags4-debuginfo
Requires:   xfce4-places-plugin
Obsoletes:  jags3, jags3-devel, jags3-debuginfo
Requires:   python34, python-matplotlib, python-matplotlib-doc
Requires:   python-matplotlib-qt4, python-matplotlib-tk, scipy, python34-tools
Requires:   python-pandas, python34-numpy,python34-numpy-f2py
Requires:   numpy, numpy-f2py, pandoc-citeproc
Requires:   pspp, git-lfs 
Requires:   xorg-x11-server-Xvfb, qca-ossl,
Requires:   postgresql-devel,
Requires:   cdo, cdo-debuginfo, chromium
Requires:   chromium, chromium-libs, chromium-libs-media
Requires:   libreoffice-TexMaths, libreoffice-math, libreoffice-nlpsolver
Requires:   libreoffice-librelogo, libreoffice-filters
Requires:    gdal-devel, gdal,  proj-devel, proj-epsg, proj-static, proj-nad

# Required for JabRef 4.3.1:
Requires:    jdk1.8

Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig

%define __jar_repack %{nil}

%description
A meta package for the lab systems


%install
rm -rf %{buildroot}
mkdir -p %{buildroot}

mkdir -p %{buildroot}/usr/local/bin
mkdir -p %{buildroot}/etc/cron.daily
install -m 755 %{SOURCE2} %{buildroot}/etc/cron.daily/R-update.sh
install -m 755 %{SOURCE3} %{buildroot}/usr/local/bin/R_labSelectInstall-03.R

# add the yum nightly updater script to cron daily
install -m 755 %{SOURCE11} %{buildroot}/etc/cron.daily/yum-update-nightly

mkdir -p %{buildroot}/usr/share/emacs/site-lisp/site-start.d
install -m 755 %{SOURCE5} %{buildroot}/usr/share/emacs/site-lisp/site-start.d/lab-init.el
mkdir -p %{buildroot}/etc/profile.d
install -m 755 %{SOURCE6} %{buildroot}/etc/profile.d/texlive.sh

# Create the directories and copy files for JabRef 4.3.1
mkdir -p %{buildroot}/usr/share/applications
mkdir -p %{buildroot}/usr/share/icons
install -m 755 %{SOURCE7} %{buildroot}/usr/local/bin/jabref
install -m 755 %{SOURCE8} %{buildroot}/usr/local/bin/JabRef-4.3.1.jar
install -m 755 %{SOURCE9} %{buildroot}/usr/share/applications/JabRef.desktop
install -m 755 %{SOURCE10} %{buildroot}/usr/share/icons/JabRef_Icon.png

%clean
rm -rf %{buildroot}

%post
/sbin/ldconfig
/usr/bin/git lfs install --system
# set Oracle JDK as default
/usr/sbin/alternatives --set java /usr/java/jdk1.8.0_181-amd64/jre/bin/java
R CMD javareconf

%postun -p /sbin/ldconfig


%files 
%defattr(-,root,root,-)
/usr
/etc

This builds just fine, but when I try to install the resulting RPM using sudo yum install ./lab-meta-1.8.1-2EL7.x86_64.rpm I receive the following error:

Running transaction check
Running transaction test


Transaction check error:
  file /usr/share/emacs from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package emacs-filesystem-1:25.1-2.el7.centos.noarch
  file /usr/share/emacs/site-lisp from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package emacs-filesystem-1:25.1-2.el7.centos.noarch
  file /usr/share/emacs/site-lisp/site-start.d from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package emacs-filesystem-1:25.1-2.el7.centos.noarch
  file /usr/share/emacs/site-lisp from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package emacs-common-1:25.1-2.el7.centos.x86_64
  file /usr/share/emacs/site-lisp/site-start.d from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package emacs-common-1:25.1-2.el7.centos.x86_64
  file /etc from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package createrepo-0.9.9-28.el7.noarch
  file /etc/cron.daily from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package crontabs-1.11-6.20121102git.el7.noarch
  file /usr from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package jdk1.8-2000:1.8.0_181-fcs.x86_64
  file /usr/share/emacs from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package autoconf-2.69-11.el7.noarch
  file /usr/share/emacs/site-lisp from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package autoconf-2.69-11.el7.noarch
  file /etc/profile.d from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package setup-2.8.71-9.el7.noarch
  file /etc from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package filesystem-3.2-25.el7.x86_64
  file /usr from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package filesystem-3.2-25.el7.x86_64
  file /usr/local from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package filesystem-3.2-25.el7.x86_64
  file /usr/local/bin from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package filesystem-3.2-25.el7.x86_64
  file /usr/share from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package filesystem-3.2-25.el7.x86_64
  file /usr/share/applications from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package filesystem-3.2-25.el7.x86_64
  file /usr/share/icons from install of lab-meta-1.8.1-2EL7.x86_64 conflicts with file from package filesystem-3.2-25.el7.x86_64

Error Summary
-------------

Obviously I can't remove the conflicting packages, as they're core system packages. I've been unable to find any similar information online or on SE. I'm sure I've just got a typo somewhere, but I can't seem to find it. Any help would be greatly appreciated!

  • perhaps you're using paths belonging to other packages in your %install section which may be better to put in the %post section. – strobelight Oct 20 '18 at 1:49
1

when you specify

%files
/usr

you are packaging the /usr directory and all its subdirectories. you need to be more specific to package only the files and directories that truly belong to your package:

%files
/usr/share/emacs/site-lisp
/etc/cron.daily/*

etcetera...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.