LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 01-24-2005, 02:51 PM   #1
rpd
LQ Newbie
 
Registered: Jan 2005
Location: Pretoria, South Africa
Distribution: Slackware (3.5) - Grey Cat Linux
Posts: 7

Rep: Reputation: 0
Does a prog *have* to be compiled for my distro?


When I try to run progs that I installed from packages, which were precompiled, it simply doesn't work.
Bash - my command interpreter - gives me the reply that the file doesn't exist! Even though I can see it right in front of me!

I have concluded that it's because I need the package to be compiled in my kernel. Is this so?
Thanks.
RPD
 
Old 01-24-2005, 02:57 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
you seem to have a bunch of different ideas about linux that don't really make sense.... not totally sure where your coming from.

to answer your actual question though, does it have to be compiled for your system, not always no. when RPM's are compiled in a server farm or wherever, they take away with them knowledge about where certain library files exist, and what their file names are. so when you drop it into your own install of that distro, the same files are there. many of these files locations and names hardly ever change between linux versions (across other distro's) so this is not a problem at all. sometimes they do change, and the program no longer runs.

there's no logic in "compiled in my kernel" that doesn't really make sense at all....

if you're having specific problems, with specific programs, post us the REAL error messages, and i'm sure we'll be able to help. one thing though, bash is "bash", not "Bash".. maybe that's your problem there? GNU/Linux shells are case senstive.
 
Old 01-24-2005, 02:57 PM   #3
kinney
Member
 
Registered: Jan 2005
Location: New York
Distribution: Slackware, Arch
Posts: 37

Rep: Reputation: 15
Not really sure what your asking but if the files is in the directory your in try

./filename

you might want to add what distro your using, what package manager your using, what package your trying to run, etc.
 
Old 01-24-2005, 03:05 PM   #4
jacks4u
Member
 
Registered: Dec 2004
Location: Phoenix, Arizona, USA
Distribution: Debian, RedHat, ???
Posts: 56

Rep: Reputation: 15
There are many reasons why your shell can't find a program to execute. They mostly have to do with paths. If bash doesn't know the path to a binary, it will not find it.

you can do some troubleshooting in this area:
Code:
$ echo $PATH
will tell you the paths that your shell knows. if the path to your program isn't listed there, it will not automatically be found and executed.
Code:
$cd /dir/program/is/in
$ ./name_of_binary_file
should execute that binary. note the './' before the binary name, which tells your shell to look in 'this directory'

The file /home/user_name/.bashrc, /home/user_name/.bash_profile, or /etc/profile, depending upon distro, may be edited to add the required path to binaries that are not in standard places, such as this:
Code:
PATH="/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games:/usr/brlcad/bin"
I hope this helps.

jacks4u

Last edited by jacks4u; 01-24-2005 at 03:14 PM.
 
Old 01-24-2005, 03:06 PM   #5
ColKurtz
Member
 
Registered: Jan 2005
Location: Earth
Distribution: Fedora
Posts: 40

Rep: Reputation: 15
From one noob to anothere...

As a beginner, stick to RPMs. Either launch them from the GUI or run RPM -i from a terminal. It forces an app to install correctly. As you learn more you'll have a better idea where to put things and how to run them - then you can move "up" to tarballs.

Also, if you *know* a file is executable and is in your current directory, try ./filename (instead of just typing the filename by itself). If you just created a script file, you need to make it executable with chmod.
 
Old 01-24-2005, 03:10 PM   #6
jtshaw
Senior Member
 
Registered: Nov 2000
Location: Seattle, WA USA
Distribution: Ubuntu @ Home, RHEL @ Work
Posts: 3,892
Blog Entries: 1

Rep: Reputation: 67
Specifically, so long as a binary executable is in ELF format it will run on any linux box. However, often times binaries are dependent on libraries that maybe or maybe not be on your system and may or may not be the correct version on your system. That is why it is usually your best bet to get packages designed for your particular distibution.

Now a verity of things could be wrong with how you are trying to do things here. What package manager did you use? How did you install the package? Is the binary in a directory in your PATH? If not you have to call it by it's absolute path (or by ./filename if you are cd to the directory it is in). Some people like to append ./ to there path so they can always run executables in there current working directory... I don't like to do this in case I'm compiling a new version of a program I already have and I want to make sure I know which one is really running (yes, this is easy to do, but I don't like to confuse myself...:-P).

EDIT: Before somebody gets ultra picky on me here... I suppose it is possible to compile your linux kernel without ELF support... but I don't know of any distro's that provide such a setup by default.

Last edited by jtshaw; 01-24-2005 at 03:11 PM.
 
Old 01-25-2005, 01:44 PM   #7
rpd
LQ Newbie
 
Registered: Jan 2005
Location: Pretoria, South Africa
Distribution: Slackware (3.5) - Grey Cat Linux
Posts: 7

Original Poster
Rep: Reputation: 0
Thanks for all the advice, but you haven't told me much I don't know. I can't use RPMs, 'cause I'm using slackware & I don't have an RPM unpacker!
The problem is not libraries that are missing, nor is it that the file not in my path. bash refuses to see the file, it seems. Even if I type ./dillo it doesn't work. bash says that dillo does not exist. But if I type ls, dillo is listed in the file list. Can anyone explain this?
I'm using Slackware 3.5 - I know it's old, but I'm running a 486!
Dillo is already executable, I checked that. It's not a script, it's an ELF file.

Thanks again,
rpd
 
Old 01-25-2005, 02:06 PM   #8
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Ubuntu
Posts: 8,507

Rep: Reputation: 123Reputation: 123
Quote:
Originally posted by jtshaw
EDIT: Before somebody gets ultra picky on me here... I suppose it is possible to compile your linux kernel without ELF support... but I don't know of any distro's that provide such a setup by default.
As of 2.6, I believe the kernel itself is ELF... and as such, the support must be present... I think
 
Old 01-25-2005, 07:17 PM   #9
jacks4u
Member
 
Registered: Dec 2004
Location: Phoenix, Arizona, USA
Distribution: Debian, RedHat, ???
Posts: 56

Rep: Reputation: 15
Perhaps there's a permissions issue? if the program is not marked as executable, then bash or other shell doesn't know how to handle it.

The man page for chmod should be informative, but to sum it all up,
Code:
$chmod u+x /my/program
sets the owner execute bit. you can also specify the actual bits, by using otal values. 0777 gives the owner, the file's group, and others read, write, and execute permission.

This may not be the case, however, because every time I've tried to do something that I'm not permitted to do, i get a permissions insufficient type error.

I have litt;e else to suggest, but I hope that helps

jacks4u
 
  


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
cd prog ahmed gamal Linux - Software 1 11-14-2005 07:55 AM
I want to start a prog from another prog but not as child grupoapunte Programming 5 05-23-2005 06:37 PM
[C prog] how to do this? dmigh Programming 7 10-31-2004 04:45 AM
Will a program compiled on one distro work on another? Razza2004 Linux - Newbie 1 05-08-2004 02:56 PM
Better buying "advanced linux prog" or "unix advanced prog" Dominik Programming 3 12-31-2003 02:11 PM


All times are GMT -5. The time now is 09:16 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration