LinuxQuestions.org
Review your favorite Linux distribution.
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 11-17-2011, 04:32 PM   #1
kaduu
LQ Newbie
 
Registered: Nov 2011
Posts: 1

Rep: Reputation: Disabled
Porting application from Redhat to Ubuntu


Hi,
Does anybody have any pointers on what are the steps necessary to be done to port an application from RedHat Linux to Ubuntu 10.04. For example can I take an application that is compiled on Redhat and run it directly on an Ubuntu box. I do understand that I would need to recompile the application on Redhat but was wondering if anybody has tried to run an app compiled one distro on another distro without recompiling.
Also any pointers to articles which list info on porting from Redhat to Ubuntu.

Thanks
Kaduu
 
Old 11-17-2011, 04:48 PM   #2
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
There is really nothing to "port", the differences between distributions are not so great that you have to go through any special steps to make it work on a specific distribution.

The only issue you may have is if the application, when compiled on Red Hat, was built against libraries which are not the same version on Ubuntu. But this isn't really a difference in distributions exactly, as the same issue could come up when trying to use a program compiled for a newer version of a particular distribution on an older version of the same distribution.

If course, if your application is compiled statically and doesn't link to any libraries in the system, then it won't matter.
 
Old 11-17-2011, 04:51 PM   #3
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,261

Rep: Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028Reputation: 2028
IF the processor is the same basic type eg x86 (intel/amd) and kernel is same base version eg 2.6.x and same bit size ie 32 or 64, THEN you can probably get away with copying the binary across from RH->Ubuntu.
Otherwise, copy the src and re-compile.
For src code langs like bash, Perl etc, should be no problem anyway.

FYI, RH has 'multi-lib', which means that a x86-64 OS also includes the libs for 32 bit and will use (ie be able to run an app) whichever is appropriate.
Don't know about Ubuntu ...
 
Old 11-18-2011, 05:00 AM   #4
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 666

Rep: Reputation: 133Reputation: 133
Quote:
Originally Posted by kaduu View Post
Hi,
Does anybody have any pointers on what are the steps necessary to be done to port an application from RedHat Linux to Ubuntu 10.04. For example can I take an application that is compiled on Redhat and run it directly on an Ubuntu box. I do understand that I would need to recompile the application on Redhat but was wondering if anybody has tried to run an app compiled one distro on another distro without recompiling.
Also any pointers to articles which list info on porting from Redhat to Ubuntu.

Thanks
Kaduu
If you are lucky (== both distributions have nearly same libraries), then you can just copy your application and it will work.

If not you can re-build application on Ubuntu from source, as was chrism01 suggested, or use statifier (http://statifier.sf.net) or Ermine
(http://magicErmine.com) to create on RedHat self-contained executable, that can be copied to any Linux distribution with recent enough kernel
 
Old 11-18-2011, 09:41 AM   #5
schneidz
Senior Member
 
Registered: May 2005
Location: boston, usa
Distribution: fc-15/ fc-20-live-usb/ aix
Posts: 3,958

Rep: Reputation: 606Reputation: 606Reputation: 606Reputation: 606Reputation: 606Reputation: 606
all linux executables should be able to run on any distribution. however a 32-bit kernel cant run a 64-bit program.
Code:
/usr/bin/dbus-launch: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped
the major difference 'tween redhat based distros and debian based distros is the package manager; how the system downloads and installs programs (yum *.rpm vs. apt-get *.deb)
 
Old 11-18-2011, 02:26 PM   #6
Valery Reznic
ELF Statifier author
 
Registered: Oct 2007
Posts: 666

Rep: Reputation: 133Reputation: 133
Quote:
Originally Posted by schneidz View Post
all linux executables should be able to run on any distribution. however a 32-bit kernel cant run a 64-bit program.
Code:
/usr/bin/dbus-launch: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, stripped
the major difference 'tween redhat based distros and debian based distros is the package manager; how the system downloads and installs programs (yum *.rpm vs. apt-get *.deb)
It's not correct. First, for any Linux executable exist minimal kernel version required to run it. In your example it's 2.6.32 Dbus launch-will not run on an system with kernel < 2.6.32
Second - shared libraries. All needed shared libraries should be present on "target" distribution and those libraries should be compatible with libraries that your executable was linked against during build time.

There are times when both of those conditions are satisfied and then executable will happily run on "foreign" distribution.
But there are also times when they are not.

Last edited by Valery Reznic; 11-18-2011 at 03:00 PM.
 
Old 11-18-2011, 02:37 PM   #7
jmc1987
Member
 
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7
Posts: 866

Rep: Reputation: 110Reputation: 110
Bring over the binaries might work but you might end of with endless amount of trouble with libraries, etc. Why not just get teh source code and compile it?
 
  


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
Porting 32bit application to 64bit on 64bit RedHat 5.4 pvpnguyen Programming 4 07-23-2010 06:52 AM
Porting C++ application from HP_UX to RH Linux nathanmca Programming 2 10-22-2009 04:01 AM
Porting COM application to Linux gnraghu Programming 1 10-05-2006 10:55 PM
Porting 32 bit application kars_jk Programming 1 01-24-2006 11:39 PM
Porting Solaris Application to Linux CaptainRon Solaris / OpenSolaris 5 10-01-2005 02:29 AM


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

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration