LinuxQuestions.org
Help answer threads with 0 replies.
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 09-23-2009, 10:59 AM   #1
DirectHit
LQ Newbie
 
Registered: Sep 2009
Posts: 11

Rep: Reputation: 0
How to compile application source code on Ubuntu using terminal


Hello people,

I know there are lot of tutorials on Internet about this topic but I am begging if someone can write step by step here an example how to get some simple .tar.gz arhcived application that is in source code and then how to use GNOME terminal on Ubuntu ( i'm using latest Ubuntu 9.04 "Jaunty Janckalope" to build it and install it?

So, I am just asking someone if he can spare 5-10 minutes and choose application from Sourceforge (some little application like Notepad2 and etc. but please if it can be in .tar.gz) and explain me step by step how to do it on Ubuntu.

Thank you.
 
Old 09-23-2009, 11:07 AM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,801

Rep: Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176
Quote:
Originally Posted by DirectHit View Post
Hello people,

I know there are lot of tutorials on Internet about this topic but I am begging if someone can write step by step here an example how to get some simple .tar.gz arhcived application that is in source code and then how to use GNOME terminal on Ubuntu ( i'm using latest Ubuntu 9.04 "Jaunty Janckalope" to build it and install it?

So, I am just asking someone if he can spare 5-10 minutes and choose application from Sourceforge (some little application like Notepad2 and etc. but please if it can be in .tar.gz) and explain me step by step how to do it on Ubuntu.

Thank you.
Sorry, that's like asking "how high is up". Different applications have different methods of installation. Some are very easy...some need you to configure the Makefile first, and others need a configuration file set up. They're all different.

If you open up most source-code tarballs, most likely you'll find installation instructions in it, that you need to follow. Most of the time, it's:

- uncompress tarball into a directory (tar xvfz <whatever name>)
- enter the directory (cd <directory name>)
- type "make"
- type "make install" (as root)

that's it. But again, they're all different, so you just need to read the installation notes.
 
Old 09-23-2009, 11:13 AM   #3
DirectHit
LQ Newbie
 
Registered: Sep 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by TB0ne View Post
Sorry, that's like asking "how high is up". Different applications have different methods of installation. Some are very easy...some need you to configure the Makefile first, and others need a configuration file set up. They're all different.

If you open up most source-code tarballs, most likely you'll find installation instructions in it, that you need to follow. Most of the time, it's:

- uncompress tarball into a directory (tar xvfz <whatever name>)
- enter the directory (cd <directory name>)
- type "make"
- type "make install" (as root)

that's it. But again, they're all different, so you just need to read the installation notes.


I understand. Can you show me an example then maybe like for ZNES emulator that you can download from here: http://sourceforge.net/projects/zsne...r.bz2/download

Thanks.
 
Old 09-23-2009, 12:24 PM   #4
archlinux_jessica
Member
 
Registered: Aug 2009
Location: PA USA
Distribution: Arch Linux
Posts: 78

Rep: Reputation: 19
Depends

My personal way. Download the tar.gz or bz2 file and simply do this.

tar vxf <file>

cd <directory name>

ls

Then I look for a few things. First thing I look for is a file named configure. If I find that then I do this.

./configure

make

sudo make install

And hope for no errors. During ./configure it will see if you have all the libraries you need to install this program, if not it will tell you what your missing. Then you have to install that with ether a package manager or download the source and go back.

If no configure file is around I look for a INSTALL file for directions on how to install. If not then I find a README file for the same. If not then I see if there is a Makefile present, and run make make install. Also btw if your getting a permissions error you need to use sudo to run as root.

Also some programs install in one of two places. Ether in /usr/bin or /usr/local/bin. Most likely you want to make sure it installs in /usr/bin. To force that you can do this instead of ./configure

./configure --prefix=/usr

That forces it to use the /usr folder instead of /usr/local folder.

-Jessica-
 
Old 09-23-2009, 12:46 PM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,072

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
Except that if you install to /usr it will taint your base system. Most times you want to separate the stuff you install by hand to either /usr/local, /opt or your home, unless you are a master dealing with file collisions, which you can expect for sure sooner or later if you go dropping random files in the middle of your OS without any care.
 
Old 09-23-2009, 12:47 PM   #6
DirectHit
LQ Newbie
 
Registered: Sep 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by archlinux_jessica View Post
My personal way. Download the tar.gz or bz2 file and simply do this.

tar vxf <file>

cd <directory name>

ls

Then I look for a few things. First thing I look for is a file named configure. If I find that then I do this.

./configure

make

sudo make install

And hope for no errors. During ./configure it will see if you have all the libraries you need to install this program, if not it will tell you what your missing. Then you have to install that with ether a package manager or download the source and go back.

If no configure file is around I look for a INSTALL file for directions on how to install. If not then I find a README file for the same. If not then I see if there is a Makefile present, and run make make install. Also btw if your getting a permissions error you need to use sudo to run as root.

Also some programs install in one of two places. Ether in /usr/bin or /usr/local/bin. Most likely you want to make sure it installs in /usr/bin. To force that you can do this instead of ./configure

./configure --prefix=/usr

That forces it to use the /usr folder instead of /usr/local folder.

-Jessica-

OK but can someone in fact take one application and show me step by step how it is done just because there are various ways it works so when I see one example I can practice it atleast?

Thank you and also can someone tell me how to use sudo to execute config.in as it dosent want to execute?

Last edited by DirectHit; 09-23-2009 at 12:51 PM.
 
Old 09-23-2009, 01:00 PM   #7
~sHyLoCk~
Senior Member
 
Registered: Jul 2008
Location: /dev/null
Posts: 1,173
Blog Entries: 12

Rep: Reputation: 129Reputation: 129
Quote:
Originally Posted by DirectHit View Post
OK but can someone in fact take one application and show me step by step how it is done just because there are various ways it works so when I see one example I can practice it atleast?

Thank you and also can someone tell me how to use sudo to execute config.in as it dosent want to execute?
You will find a README file , always read that since maybe you need to follow a different procedure for that particular app.
 
Old 09-23-2009, 01:06 PM   #8
DirectHit
LQ Newbie
 
Registered: Sep 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by ~sHyLoCk~ View Post
You will find a README file , always read that since maybe you need to follow a different procedure for that particular app.

I just need simple example by application... so I can practice on it

And also, if someone please can tell me how do I execute .txt or that kind of files in terminal? And what when I get "Premission denied" ? How to use sudo to execute it properly so I don't get that message?

Thanks.
 
Old 09-23-2009, 01:10 PM   #9
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,072

Rep: Reputation: 384Reputation: 384Reputation: 384Reputation: 384
Quote:
Originally Posted by DirectHit View Post
And also, if someone please can tell me how do I execute .txt or that kind of files in terminal? And what when I get "Premission denied" ? How to use sudo to execute it properly so I don't get that message?

Thanks.

.txt files are not executable files. You don't execute them, you open them with whatever program suits the file. txt files are usually text files, so you would open them with a text editor (nano, vim, emacs, joe, jed, kata, bluefish, gedit, to name just a few) or use cat, more, less or a similar tool to dump their contents on your screen for a quick review (assuming that's plain text, and not a formatted document).

It's perfectly normal that data file don't have execution permission, there's nothing wrong with that at all. Most desktops (gnome and kde for example) will allow you to open these files by clicking or double clicking on them, but don't be faked, they are still not being executed. It's the desktop who calls the editor for you and open the file using that editor.

sudo has nothing to do here, its purpose is to scale privileges, and you really shouldn't be using it for anything but administrative tasks. If you find yourself using sudo every 5 minutes you are doing something very wrong.
 
Old 09-23-2009, 01:12 PM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
how do I execute .txt or that kind of files in terminal
To read a txt file
Code:
less foo.txt
Quote:
And what when I get "Premission denied" ? How to use sudo to execute it properly so I don't get that message?
sudo command_you_want_to_execute
Code:
sudo less foo.txt
 
Old 09-23-2009, 01:12 PM   #11
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 18,801

Rep: Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176Reputation: 4176
Quote:
Originally Posted by DirectHit View Post
I just need simple example by application... so I can practice on it
Again..they're all different. READ THE INSTRUCTIONS THAT COME WITH THEM. We've all given you examples of what to do, so go download one, read the instructions, and practice.

Quote:
And also, if someone please can tell me how do I execute .txt or that kind of files in terminal? And what when I get "Premission denied" ? How to use sudo to execute it properly so I don't get that message?

Thanks.
You don't execute .txt files. You can display them on the screen with the cat command (read the man page for cat, usage like "cat <file name>"), or open them in an editor (doesn't matter which...gedit, vi, emacs), and read them. If you get permission denied, you can do "sudo cat <file name>", or "su - root", then enter the root password, then read it.
 
Old 09-23-2009, 01:18 PM   #12
archlinux_jessica
Member
 
Registered: Aug 2009
Location: PA USA
Distribution: Arch Linux
Posts: 78

Rep: Reputation: 19
i92guboj - Thank you. You're right. Should just use the defaults in most cases where the file should go. The only time I've had to use --prefix=/usr was during library installs to manually update my libraries (Which should be handled with care because a few times I've broke my system doing that.)

But back to the article. What your asking us to do is install a program from source we may already have installed by a package manager or already have set up exactly the way we want. The best way to learn is to try yourself. I gave you a step by step walkthrough on how I install things from source. If you get a error, try and Google it and learn whats wrong. Sometimes if you get a error, first thing I do is go to the README or INSTALL text file to see if there's a dependency they mention that I don't have. If I cant find it, I will look at the software's Home Page to get that information.

I am not on my Linux box atm so I can't install anything from source, and at home I have a fully set up box configured the way I want with pacman package manager, so I don't want to handle anything that may potentially break my current setup. If you have something you want to install, try installing it! If you can't get it installed and cannot figure out why, then ask on here with the error you got and any information you can give. That's how we can help you. Please try it yourself and come back to us if you have problems.

-Jessica-
 
Old 09-23-2009, 01:21 PM   #13
DirectHit
LQ Newbie
 
Registered: Sep 2009
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by archlinux_jessica View Post
i92guboj - Thank you. You're right. Should just use the defaults in most cases where the file should go. The only time I've had to use --prefix=/usr was during library installs to manually update my libraries (Which should be handled with care because a few times I've broke my system doing that.)

But back to the article. What your asking us to do is install a program from source we may already have installed by a package manager or already have set up exactly the way we want. The best way to learn is to try yourself. I gave you a step by step walkthrough on how I install things from source. If you get a error, try and Google it and learn whats wrong. Sometimes if you get a error, first thing I do is go to the README or INSTALL text file to see if there's a dependency they mention that I don't have. If I cant find it, I will look at the software's Home Page to get that information.

I am not on my Linux box atm so I can't install anything from source, and at home I have a fully set up box configured the way I want with pacman package manager, so I don't want to handle anything that may potentially break my current setup. If you have something you want to install, try installing it! If you can't get it installed and cannot figure out why, then ask on here with the error you got and any information you can give. That's how we can help you. Please try it yourself and come back to us if you have problems.

-Jessica-
Thanks. Understood

You can close the topic. Thanks on help once again
 
Old 09-23-2009, 01:24 PM   #14
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,528

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
You can close the topic. Thanks on help once again
Only you can mark the thread solved in the thread tools
 
Old 09-23-2009, 01:34 PM   #15
linuxpokernut
Member
 
Registered: Jul 2007
Distribution: Slackware 14
Posts: 237
Blog Entries: 8

Rep: Reputation: 59
Code:
sh-3.1$ cd Downloads
sh-3.1$ ls
zsnes151src.tar.bz2
sh-3.1$ tar -xvjf zsnes*
sh-3.1$ ls
zsnes151src.tar.bz2  zsnes_1_51
sh-3.1$ cd zsnes_1_51
sh-3.1$ ls
docs  src
sh-3.1$ cd docs
sh-3.1$ ls
README.LINUX  install.txt  readme.1st  srcinfo.txt  thanks.txt
README.SVN    license.txt  readme.htm  stdards.txt  todo.txt
authors.txt   opengl.txt   readme.txt  support.txt
sh-3.1$ cat README.LINUX
at this point you have the linux readme open...
Read it....
Quote:
If you are using debian or ubuntu be sure to install libsdl-dev
so....
Code:
$sudo apt-get install libsdl-dev
when thats done
Code:
sh-3.1$ cd ..
sh-3.1$ cd src
sh-3.1$ ls -h
sh-3.1$ ./configure
I had to lol @ this...

Quote:
Configure complete, now type 'make' and pray.
Code:
sh-3.1$ make
And there she is.
 
  


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
source code for application installed thru apt-get sg08 Linux - Software 11 05-06-2010 02:21 PM
SuSE 10.1 will not install any application source code. Where is it? tiger9999tiger SUSE / openSUSE 2 07-02-2006 02:33 PM
Install application from source code UltraSoul Linux - Software 2 07-29-2005 01:23 PM
how i compile a source code? nazib Linux - General 5 02-27-2005 09:13 AM
How to compile source code... Grim Reaper Linux - Newbie 3 04-26-2002 11:28 AM


All times are GMT -5. The time now is 10:03 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