3 ms·
Sometimes, the easiest thing is to just compile a binary elsewhere, and drop it into the system. Especially when you are dealing with CentOS (RHEL, Scientific L
by captainmuon 12y ago
Sometimes, the easiest thing is to just compile a binary elsewhere, and drop it into the system. Especially when you are dealing with CentOS (RHEL, Scientific Linux, ...).
"Linux"* is usually forward-compatible, meaning that a binary compiled with an old system will run on a newer one. Maybe you have to bring all your own libraries with you, and place them on LD_LIBRARY_PATH, but you can get it to work. I can't count the times I had to extract .so files from RPMs I found on the net. Feels a bit dirty, but surprisingly works.
Actually, at one point I compiled my own glibc (simultaneously with GCC), and then the full GTK stack. I played a bit with RPATH so the binaries looked for libraries at relative, not fixed paths. Then I could just drop the whole usr tree somewhere, source a script (setting a few variables) and I was able to run current software, including current versions of Skype, Firefox, and LibreOffice on my ancient OS at work. There are binaries for the latter two, there is no way I would compile those, too.
Its a bit unfortunate that there is no "culture" of using binaries when necessary on Linux. If people were more aware of the use cases and details, the experience would be a lot smoother. For example, creators of binaries could compile against older system libraries to get maximum compatibility. Or, you could have bundles of libraries (distribution-agnostic, and not installed in /usr) to run new apps on an old OS. Ironically, Windows has the distribution of third-party binaries figured out much better... although I do not envy Windows for the installation situation there, and in 90% of cases prefer the package managers of the Linux world.
(* And here, I mean Linux distributions, not just the kernel. So Linux+glibc+GNU+bash+X11+related stuff, but maybe a few of those are swapped out for alternatives. Just a reasonably GNU/Linux-Like Posixy System, but not Cygwin or OS X.)
(* * Which I was stuck with for reasons out of my control.)
- fragmede 12y ago> The reason that there is no "culture" of using binaries when necessary I don't understand what you mean. Outside of Gentoo, most distros are based on binaries - I don't need to install GCC in order to install programs via 'apt-get' or 'yum install', nor do I need GCC in order to run them. -- Assuming you mean 'culture of not using the built-in package manager', here's what I think: While I've definitely done "scp a.out $other_system:" that only works for the most trivial of programs. After you accumulate a few more files, it becomes "scp foo.tgz $other_system:" because there're some library files/whatever to be included. But then it turns out some of those files need to get put in the right place, so the next step is a rudimentary runme.sh script that sets up the system. Hang on, what's the last version we 'installed'? Just have runme.sh stick version info in /etc/foo.conf. Congratulations, you've got a rudimentary packaging system! The reason there's no culture of avoiding the package manager is because it's there to help you so you don't have to manually hunt down rpm files to extract .so files, among other things. (If I never have to use rpmfind.net again it'll be too soon.)