LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   Question about executables/binaries (http://www.linuxquestions.org/questions/linux-general-1/question-about-executables-binaries-4175465113/)

Driverman 06-07-2013 08:27 AM

Question about executables/binaries
 
When you download a package in a distribution like Ubuntu, that comes with binaries, right? In other words in most cases it doesn't compile source on the spot.

If that's correct, are the only requirements for running a binary on a given Linux system that the architecture of the binary match the system and that all required shared objects be available? I ask because at work, there are a few programs that I'd like to use on machines that I only have SSH access to which are not available on those systems. It also seems like the development toolchains are lacking, so I was hoping to build my binaries on my VM and then run them in userspace.

John VV 06-07-2013 04:24 PM

on Ubuntu 12.10 you use apt-get package manager to install programs built fro that operating system from the software repositories

most times for most all everyday programs there is no need to build from source code
-- you "can" if you want to but it is WAY easier to use the package manager

mariose 06-08-2013 02:45 PM

Quote:

Originally Posted by John VV (Post 4967426)
on Ubuntu 12.10 you use apt-get package manager to install programs built fro that operating system from the software repositories

most times for most all everyday programs there is no need to build from source code
-- you "can" if you want to but it is WAY easier to use the package manager

Yes, you would normally use
Code:

sudo apt-get "package name"
(without the quotation marks)

Regards
Marios

Driverman 06-16-2013 07:19 PM

Right, I use apt all of the time. I mean more like, let's say I have two different distros of Linux -- maybe Ubuntu and CentOS. Both are running on identical hardware with a 32 bit install. Let's say I download a prebuilt binary using package management on the Ubuntu box. Could I, in theory, copy all appropriate configs and shared object files that that binary file relies on to the CentOS box and run it? I know that'd be exceptionally messy, but I'd like to understand this.

John VV 06-16-2013 07:41 PM

Some things -- yes --
but for most things - about 99%+ NO

i reuse fonts and icons from fedora on my ScientificLinux6 and OpenSUSE 12.2 installs
and there are a few games that are in the fedora repos that will run on cent or opensuse
BUT these are all RPM based distros

for ubuntu ,which is moving away from the standard linux model , deb's to run on CentOS
you would be looking at fonts and icons mostly


every so often something might
one example ( on my set up ) is i have a rather large and COMPLEX group of programs called " ISIS3
-- from NASA/JPL and the USGS -- it is a type of GIS software .

it is built for RHEL6
it has NO problems running on OpenSUSE 12.2
but will NOT work on fedora 15,16,17,18

Driverman 06-16-2013 07:49 PM

I'm not talking about installing a .deb on CentOS. I'm talking about taking the actual executable file and running it in the manner in which I described.

sundialsvcs 06-16-2013 09:03 PM

Offhand, I'd say that "it would be an 'interesting exercise' that 'might' work" ... but that, when you are maintaining a software system 'for a living,' you're really making things harder for yourself when you do such things. The problem is that there are many subtle dependencies between the thousands of software components in a system. (If you don't believe that, just try Gentoo, or Linux From Scratch!)

The packagers of "distros" endeavor to do all of that work, precisely so you don't have to. They also provide for ways to efficiently update a large number of servers without repeating the entire same update-procedures on every single one.

If you try instead to "ride the pony bareback," well, as I said, "it might work" ... but here's the rub ... "it might not work, and not-work in such a way that you do not know it." So, the justification for the business risk, IMHO, is simply not there.

Driverman 06-16-2013 10:04 PM

I don't want to know if it would work so I could do it in a production system. I want to know if it would work in an effort to better understand the underlying structure of these systems in general.

chrism01 06-16-2013 11:46 PM

The key word in sundialsvcs's post is 'might'... There's no way to be sure without trying it.
As above, if you REALLY want to understand the deep details, try build/installing LFS or Gentoo or similar.

Driverman 06-17-2013 06:41 AM

If it "might," what factors would potentially stop it from working? I've done LFS once, a long time ago, and yeah I imagine that I should do it again soon. I was just curious as to whether there were any obvious technical reasons why it wouldn't work.

pan64 06-17-2013 06:49 AM

So if you have all the required shared objects and environment you will be able to run your app. If you have version mismatches or (similar) minor incompatibilities you might be able to run that app. Possibly you will get segmentation fault or other strange errors. (Otherwise you will not be able to do that.)

Driverman 06-17-2013 06:59 AM

Awesome, thank you :)


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