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-17-2009, 07:54 AM   #1
zhangke
LQ Newbie
 
Registered: Jan 2009
Location: China
Posts: 6

Rep: Reputation: 0
Unhappy How to run a binary program under Linux


Hello everyone!
Coz I am a newbie of Linux,I wanna logged in QQ(a very popular IM in China)to communicate with my e-pals.
After I downloaded Linux QQ and extracted it,I found it's difficult to run it.
Its properties shows as follow

Type:binary program
Size:2.1 MB
MIME type:application/x-exectuable-binary

How can I run it?Do me a favor please
 
Old 01-17-2009, 08:15 AM   #2
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958
One, what Linux distribution are you running? Different distros have different ways to manage software installation.

Two, which version of QQ do you have? I found the download page here, and they offer a .deb type package for Debian-based distros, an .rpm package for Redhat/Suse, and a tar.gz package, which is a generic source package that needs to be compiled before it can be used. (I'm not too sure what the fourth one is, it looks like source coded for a specific kind of platform--something for portables?)
 
Old 01-17-2009, 08:16 AM   #3
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
How about listing the program. Also look on the site for a readme.
Also run "file <filename>" and see if it says that it is an elf binary. If so, you can probably change the permissions and copy it to /usr/local/bin.

eg:
sudo chown root.root <filename>
sudo chmod u=rwx,go=rx <filename>
sudo cp <filename> /usr/local/bin/

Check if /usr/local/bin/ is in your path:
echo $PATH

If it isn't then add these lines to your ~/.bashrc file:
PATH=$PATH:/usr/local/bin
export PATH

---

Sometimes when you download a file, it will be a binary installer. Usually when this happens, it will have an .bin extension.
The .bin extension isn't needed. It is just a convenience. If this is the case, run "sh <filename>" or "chmod +x <filename> && ./<filename>"

---
I've been using <filename> because you didn't supply the name of the file. Use the name of the file without <,> in place of <filename>.
 
Old 01-17-2009, 08:27 AM   #4
zhangke
LQ Newbie
 
Registered: Jan 2009
Location: China
Posts: 6

Original Poster
Rep: Reputation: 0
Oh my dear friends,thank u two first
David,mine is tar.gz package



and jschiwal

file qq
qq: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.6.9, dynamically linked (uses shared libs), stripped

after I selected copy file and switched to the /bin
the "paste files" is disabled
I don't know what should I do
 
Old 01-17-2009, 08:33 AM   #5
zhangke
LQ Newbie
 
Registered: Jan 2009
Location: China
Posts: 6

Original Poster
Rep: Reputation: 0
and my OS version is Red Hat Linux 9
 
Old 01-17-2009, 09:20 AM   #6
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Why not install a more recent Fedora distro. RH9 is ancient. I don't understand why people still download it. Red Hat doesn't support it any more for security updates, so using RH9 could be dangerous.

---

You first said that the download was a .tar.gz file. Then you said it was named "qq" so I am a bit confused which it is. Do you mean that you extracted the archive and there was a qq file inside? There probably is a README file inside as well with instructions. If there is a qq/ directory extracted, then check if there is a "configure" file and a README file inside.

Sometime, the software has an install program. Sometimes a "Makefile" is present that will perform the installation for you if you run "sudo make" inside the directory.

Use the terminal to copy the file, (if there is no readme) and the file is by itself. "sudo cp gg /usr/local/bin". The /usr/local/ prefix is used for programs you install itself, although you could use /usr/bin/ instead. Leave /bin/ alone. There should just be core utilities and programs there that the system needs to run its basic functions.

Notice my use of sudo. Your problem is that you don't have write permission for the /bin/ directory. That is normal. You should rarely run a GUI program as root.
 
Old 01-17-2009, 09:34 AM   #7
zhangke
LQ Newbie
 
Registered: Jan 2009
Location: China
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Do you mean that you extracted the archive and there was a qq file inside?
yep,I am sorry for my poor English

After extracted,there are two files---->"QQ" and "res.db"

I tried the command and the terminal replied me like this
sudo cp qq /zhangke/local/bin
zhangke is not in the sudoers file. This incident will be reported.


thank u very much
 
Old 01-17-2009, 09:53 AM   #8
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958
Ok, I downloaded the tar.gz file and opened it up. It seems I was wrong about it being a source file, because the only things inside it are the qq binary and a "res.db" database file. This means that it's very easy to run it; simply cd to the directory it's in and type "./qq". The ./ in front of the name tells bash to execute the command in the current directory. Alternately, you can type the full path name, such as "/home/david/temp/qq".

If you want to make it launchable without specifying the path, then you need to add the directory to your PATH shell variable. The command "echo $PATH" will show you which directories bash looks in when trying to run a command.

For a single-user installation, you should create a directory /home/username/bin and place the files you want to run there. Then edit your /home/username/.bashrc file (note the period in front of the filename, which makes it a hidden file), and edit (add it, if it doesn't exist) the PATH line in it to read PATH="/home/username/bin:$PATH". Then any new shells started for that user should be able to launch the program.

You can also "install" the program globally instead by putting the qq binary in /usr/bin or /usr/local/bin (the second is more common for manual installs). But in this case it appears you also need to have a copy of the res.db file in your home directory for the program to run.
 
Old 01-17-2009, 06:19 PM   #9
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
I'm not certain where it expects the .db file. Is there a readme or faq on the site, please read it.

Quote:
sudo cp qq /zhangke/local/bin
Your home directory should be in /home/zhangke/. Linux will still work with /zhangke, but using the standard will make
it easier for people to help you on this site and make documentation make for sense. It you are putting the program in your home directory, you don't need to use sudo.

It also looks like you don't have your sudoers file configured. You can fix that.
1) Add yourself to the "wheel" group.
2) Run "sudoers" and uncomment the line: "# %wheel ALL=(ALL) ALL" by removing the "# " from the beginning. Even if you don't
need sudo now, you will later on.

Since this program is used with a service on the net, you could try emailing them if you have a problem.

---

If you really have RH9 and didn't mean Fedora 9, then I would recommend using a recent version or Fedora. You may have problems installing tarballs or running programs because the libraries and kernel that RH9 is based on may be obsolete.
You will end up spending more time getting hardware or software to work than a new download and install would take.
 
Old 01-17-2009, 06:40 PM   #10
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 210Reputation: 210Reputation: 210
I would recommend against copying any random binary into your $PATH locations. Bad practice. As stated above, run a program with
Code:
./program_name
. If you're going to "install" a binary, you should probably either install it's package with
Code:
yum install pacakage_name
or if no packaged version is available, compile it yourself and use
Code:
make install
. Or compile it yourself and then make a package of it and then install it. Once the software is installed you can drop the ./ and just refer to it by its name, as it will then be found in your $PATH.
 
Old 01-17-2009, 07:48 PM   #11
zhangke
LQ Newbie
 
Registered: Jan 2009
Location: China
Posts: 6

Original Poster
Rep: Reputation: 0
before I came to here,I've googled the ways to run a program and tried the ./programname approach
the terminal responsed "Floating point exception" then I thought the way must be wrong
David,have you run QQ successfully?
I am considered a new edition of Linux now

thank u very much for your help=_=
 
Old 01-17-2009, 07:55 PM   #12
jhwilliams
Senior Member
 
Registered: Apr 2007
Location: Portland, OR
Distribution: Debian, Android, LFS
Posts: 1,168

Rep: Reputation: 210Reputation: 210Reputation: 210
Having looked up QQ, I might suggest that you use Pidgin as a chat client. Pidgin supports the QQ protocol and the UI has been translated into Chinese.

Last edited by jhwilliams; 01-17-2009 at 07:56 PM.
 
Old 01-17-2009, 10:02 PM   #13
David the H.
Bash Guru
 
Registered: Jun 2004
Location: Osaka, Japan
Distribution: Debian sid + kde 3.5 & 4.4
Posts: 6,823

Rep: Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958Reputation: 1958
I got the tar.tgz version to run successfully. Well, at least the first window comes up, I don't know how to use it from there.

The res.db file seems to need to either be in the same directory as the executable or in the user's main home directory. When I tried copying it to /usr/local/bin and running it from there, it failed to work until I put res.db in home, then it worked fine. Putting both files in /usr/local/bin didn't work.

Assuming you really are using RH9, I'd have to guess that's the problem. The one thing I can read on the download page is that it requires a minimum 2.6 kernel and 2.10 GTK library. But Google tells me that RH9 still used the 2.4 kernel, am I right? Please post the output of "uname -a" so we can confirm what platform you're running.
 
Old 01-18-2009, 02:50 AM   #14
zhangke
LQ Newbie
 
Registered: Jan 2009
Location: China
Posts: 6

Original Poster
Rep: Reputation: 0
Quote:
Linux localhost.localdomain 2.4.20-8 #1 Thu Mar 13 17:54:28 EST 2003 i686 i686 i386 GNU/Linux
you are right
how can I solve the problem?update my OS?
but I don't know how to do it,I installed the RH9 from CDS
 
Old 01-18-2009, 02:56 PM   #15
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Do book stores in your area carry the British based magazines that contain a DVD of a distro each issue? You could download a CD or DVD or use bit torrent. Some distro's also have a small net install image that you can burn to CD and install the main distro over the internet.
 
  


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
Run win32 program in Linux Asuralm Linux - Software 5 01-23-2008 11:36 AM
i cant run c program in linux anyone can help me? amit_linux Linux - Software 10 05-31-2007 07:23 AM
QUICKEN-like program to run on LINUX dinchl Linux - Software 4 02-11-2007 01:40 PM
Run WINNT Program in Linux ckamheng Linux - Software 7 05-07-2003 09:21 AM
Why won't this binary run? islandkid Linux - General 15 09-01-2002 02:51 PM


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

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