LinuxQuestions.org
Register a domain and help support LQ
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-14-2009, 02:43 PM   #16
stratotak
Member
 
Registered: Sep 2005
Distribution: Today Debian . Tomorrow ..??
Posts: 386

Rep: Reputation: 39

the alsa post ..I believe he posted it by mistake in wrong thread...
run ./configure again and post last section of it..example..I downloaded clam source and ran configure..

configure: unable to compile/link with check
checking pthread.h usability... yes
checking pthread.h presence... yes
checking for pthread.h... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for zlib installation... /usr
configure: error: Please install zlib and zlib-devel packages

as you can see it say install zlib ..look for a error like that..and resolve it..then run .configure again
and only time you enter root is at make install
If you run ./configure or make as root you will not be able to delete or move source as user

Last edited by stratotak; 01-14-2009 at 02:46 PM.
 
Old 01-15-2009, 05:55 AM   #17
b0uncer
LQ Guru
 
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
This has been covered in numerous threads, but I'll repeat it here: there are several ways to gain root privileges when they are needed (in this case, to run "make install" in the end if it works that way). They are mostly the same, but do have some differences. Some examples:
Code:
su
User becomes root, but the user's environment remains. In some distributions (Fedora is one, I think) some of the needed programs may be in sbin/ directories which are listed in the $PATH environment variable of root, but not in that of users. This means: if one uses "su" to become root, those programs are not found just by issuing their name; instead full path to the executables needs to be written, or then the appropriate directories need to be added to $PATH before going on.

Code:
su -
The same as above, but now the environment will not be what it was when the user issued "su", but will become that of the root user (as if root had just logged in). Now for example programs in directories listed in $PATH of root will be found, but on the other hand if the regular user (that ran "su") had some special environment variables set, they're not present.

Code:
sudo programname
Runs 'programname' with root privileges, requires sudo to be on the system and configured to allow this user to run 'programname' with it. Requires user password. If you have sudo configured (like on Ubuntu out of the box), do use it.

Then you can actually login as root, but that's about the same as if you just used "su -" to become root. It is also possible that when you become root using the "su" program, your current working directory is automatically changed to root home directory, which means you may have to re-navigate to the source directory..so if you're not sure,
Code:
pwd
and see that it's all right.

Typically you should run all the other installation steps (if not adviced otherwise) as a regular user except for the (usually) last one(s), where the compiled files are actually copied to your filesystem; you don't need root privileges here unless the files are copied to such directories where you don't have write permission. Most of the time, though, the "install" step copies something to bin/ and so on, and this does require you to have higher privileges, so practically you'll have to have root privileges then..but like stratotak pointed out, you should run the earlier steps (configure script, make, ...) as a regular user so any files that may be created are also owned by you. If they're not, it's ok except that you usually can't move/remove them because you don't own them..

Reading the README/INSTALL files is good also because they'll mention if you have to set some extra environment variables during the compilation (not common, but possible) and if you should be doing some steps with certain privileges; for example if the installation failed unless you ran some parts as regular user, then some parts as root. There may also be information on how you should run the compiled software after it's installed; some programs don't run as root at all, usually for security reasons.
 
Old 01-15-2009, 06:11 AM   #18
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
Just an FYI. Only run the last step, "make install" as root. So you can run "sudo make install" instead in the last step.

The ./configure script analyzes your system and generates the "Makefile". Without the Makefile, the "make" command won't work.
So, no, the ./configure step is mandatory.
 
Old 01-15-2009, 09:14 AM   #19
agrestic
Member
 
Registered: Jan 2009
Location: atlanta, ga, usa
Distribution: sabayon 5, slack64, Lenny, LFS 6.4 user # 20665
Posts: 61

Rep: Reputation: 16
I've found it's useful to have the following installed for compiling programs:
Code:
sudo apt-get install scons binutils-dev libelfg0 libelfg0-dev libcppunit-dev libx11-dev libgl1-mesa-dev zlib1g-dev g++ gcc pkg-config
With these, I can't think of a program not installing properly (except for Enemy Territory 2.55, which needs libgtk1.2).
Of course, this refers to debian-based distros like ubuntu.

Last edited by agrestic; 01-15-2009 at 09:15 AM. Reason: debian-based info
 
Old 01-15-2009, 09:49 AM   #20
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
One thing to add. Often a package will require certain library packages as dependencies. When compiling from source, you will probably need the cooresponding -devel package. So a project that depends on libpng, will need libpng-devel if compiling from source. The -devel versions will contain the static libraries and the header files for the libraries to define it's functions.

Last edited by jschiwal; 01-19-2009 at 09:52 PM. Reason: typo
 
Old 01-15-2009, 01:47 PM   #21
stratotak
Member
 
Registered: Sep 2005
Distribution: Today Debian . Tomorrow ..??
Posts: 386

Rep: Reputation: 39
If your on a Debian based distro.Im assuming Ubuntu,Mepis,and other Debian based are the same.You can use apt-get build-dep "package name"
for example.. apt-get build-dep vlc and it will install all the dev packages it will need to
build vlc..but i dont believe there is a command to remove them after you have done building it..so if package you build has a lot of dev packages its going to install..you can in terminal.. use mouse to copy and paste the packages names and save it to a text file..so all you have to do is apt-get remove and paste it back into terminal.Im pretty sure a linux guru would have a better way about this
 
  


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
module.ko: make, install & used many times. Suddenly modprobe=invalid module format?? GrapefruiTgirl Linux - General 16 08-04-2007 06:40 AM
[root@oprations Module]# make make -C /lib/modules/2.6.18-1.2798.fc6/build SUBDIRS=/r korotania Fedora 7 06-22-2007 04:12 PM
How do I make an install from root ? Max Linux Linux - Newbie 7 06-30-2006 08:42 PM
How to make rule for make install and make uninstall melinda_sayang Programming 1 06-14-2004 06:58 AM
make install by root or lfs? bingbang Linux From Scratch 2 02-29-2004 11:36 AM


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