LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 09-23-2017, 09:33 AM   #1
ilesterg
Member
 
Registered: Jul 2012
Location: München
Distribution: Debian, CentOS/RHEL
Posts: 587

Rep: Reputation: 72
Centos RPM - unable to install relocatable openssh package


Hi!

I'm newbie at building on Linux.

My first project is to build rpms on a build machine with build software ("Development Tools" group, cmake, openssl-devel, etc.) then install them on another machine which acts something like a production machine (no build tools).

The newly built software should be installed on application directories such as /tools/prod/. As a result the production machine would have multiple versions of the same software (ex. OpenSSH) on the machine.

I was able to build and create an rpm for openssh:
Code:
[percyy@build ~]$ ls -l /tools/build/rpmbuild/RPMS/x86_64/
total 1244
-rw-rw-r--. 1 percyy percyy 423072 Sep 23 21:59 openssh-6.7p1-1.x86_64.rpm
-rw-rw-r--. 1 percyy percyy 461764 Sep 23 21:59 openssh-clients-6.7p1-1.x86_64.rpm
-rw-rw-r--. 1 percyy percyy  17072 Sep 23 21:59 openssh-debuginfo-6.7p1-1.x86_64.rpm
-rw-rw-r--. 1 percyy percyy 363848 Sep 23 21:59 openssh-server-6.7p1-1.x86_64.rpm
[percyy@build ~]$
These packages were build with only the "Prefix" value as a modification to the spec file.
Code:
Prefix: /tools/prod
Result:
Code:
[percyy@build ~]$ rpm -qpi /tools/build/rpmbuild/RPMS/x86_64/openssh-*.rpm | grep Reloc
Relocations : /tools/prod
Relocations : /tools/prod
Relocations : /tools/prod
Relocations : /tools/prod
[percyy@build ~]$
But when installing this on the production machine, I get the following error:
Code:
[percyy@cent7 ~]$ sudo rpm -ivh --prefix /tools/prod /home/percyy/openssh-6.7p1-1.x86_64.rpm
Preparing...                          ################################# [100%]
        package openssh-7.4p1-12.el7_4.x86_64 (which is newer than openssh-6.7p1-1.x86_64) is already installed
        file /etc/ssh/moduli from install of openssh-6.7p1-1.x86_64 conflicts with file from package openssh-7.4p1-12.el7_4.x86_64
        file /usr/bin/ssh-keygen from install of openssh-6.7p1-1.x86_64 conflicts with file from package openssh-7.4p1-12.el7_4.x86_64
        file /usr/libexec/openssh/ssh-keysign from install of openssh-6.7p1-1.x86_64 conflicts with file from package openssh-7.4p1-12.el7_4.x86_64
        file /usr/share/man/man1/ssh-keygen.1.gz from install of openssh-6.7p1-1.x86_64 conflicts with file from package openssh-7.4p1-12.el7_4.x86_64
        file /usr/share/man/man8/ssh-keysign.8.gz from install of openssh-6.7p1-1.x86_64 conflicts with file from package openssh-7.4p1-12.el7_4.x86_64
        file /usr/bin/scp from install of openssh-6.7p1-1.x86_64 conflicts with file from package openssh-clients-7.4p1-12.el7_4.x86_64
        file /usr/libexec/openssh/ssh-pkcs11-helper from install of openssh-6.7p1-1.x86_64 conflicts with file from package openssh-clients-7.4p1-12.el7_4.x86_64
        file /usr/share/man/man1/scp.1.gz from install of openssh-6.7p1-1.x86_64 conflicts with file from package openssh-clients-7.4p1-12.el7_4.x86_64
[percyy@cent7 ~]$
I thought that I can install all the files on a single location (/tools/prod) just by adding the Prefix value in the spec file during build. Apparently this is not enough.

What else do I need to do?

TIA.
 
Old 09-23-2017, 02:23 PM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,292

Rep: Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322Reputation: 2322
It seems to be puking on having 2 different versions of openssh. You have several options
1. Get the source of the same version for your rpms. You might then get 'already installed' errors, and it doesn't last beyond the next update.
2. Build an rpm to update your Red Hat openssh. You might then get 'already installed' errors, and it doesn't last beyond whatever version you have.
3. Back up, then man up and employ the override options in rpm. Things like --noarch, --nodb, --just-db, --nodeps allow you to break rules. That has consequences as every openssh update henceforth causes a fight.
4. When you consider yourself ready or somewhat experienced at doing stuff in a console/terminal, grab a less restrictive distro. Slackware and it's offspring, or LFS spring to mind, although debian/ubuntu/mint or their offshoots may do.

Slackware's package management allows that sort of messing by default, but there's no dependency checks. The stage that says: "To install that, you need all these as well," never happens at all in Slackware or LFS, so your new package can install & then puke for the lack of something. When I wanted Freecad I found it handier to install Mint in a VM than the 25 or so python modules it required in Slackware (Available only by Slackbuild, which are bash scripts to knock a package together). Mint stuck in the modules automagically. I keep a VM for crap like that now.
 
  


Reply

Tags
build, centos, development, openssh, redhat



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
Error unpacking rpm package httpd-2.2.15-45.el6.centos.x86_64 on centos 6.5 rookie5 Linux - Server 5 01-09-2019 05:55 PM
RPM Pacakages and YUM Packages unable to install in CentOS 6.4(Purpose Training) KishanITIL Linux - Newbie 4 10-20-2014 03:49 PM
rpm error: path /opt/**.** in package DMCmdline-14.00.00 is not relocatable rminnals Linux - Software 0 05-11-2012 05:17 PM
How to build httpd-2.2.3-22 as a relocatable rpm package in RHEL 5.3 renjunix Linux - Server 3 11-02-2009 09:04 AM
Yast unable to install RPM Package Error Message ebrarian SUSE / openSUSE 3 03-22-2007 12:45 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:15 AM.

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
Open Source Consulting | Domain Registration