Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I recently installed LAME encoder on my server to convert wav to mp3 and that worked with './configure, make, make install;

I then tried to install OGG encoder and that requires './configure, make, sudo make install' - which I cannot do, since I dont have a VPS (and I'd rather not pay $15 a month for a VPN just to install a codec).

I'm new to all this, and I understand sudo gives you permissions - but I have been trying to find out why exactly some 'make installs' require sudo access and others dont. I haven't yet found the answer. Again, very knew to this so i'm just trying to learn whats going on.

share|improve this question

migrated from stackoverflow.com Nov 29 '11 at 23:52

This question came from our site for professional and enthusiast programmers.

    
You should be able to change the Makefile (or some template that the Makefile is generated from) or pass command-line options to something (probably ./configure) in order to make it install in a different directory (presumably one you don't need sudo to access). –  Chris Lutz Nov 2 '11 at 1:29
add comment

3 Answers 3

Usually I try to run it without sudo anyway - sometimes it works. Sometimes package creators think sudo is required, they use it due to their preference, or otherwise choose to install things in non-user areas of the system. Sometimes this is necessary, but many times it isn't.

The other common reason I see for the use of sudo is in blog posts by 3rd parties that explain how to install software, and rather than go the extra mile and explain to you how to install it without sudo privileges, they tell you to use sudo because the person writing the post simply uses sudo for everything, which isn't really a good idea.

Theoretically, the only reason a package should require sudo is if it needs (or decides) to install itself into/otherwise modify areas of the system that can only be modified via administrator access.

Generally speaking, fewer and fewer packages are still doing this, as the need for users to install some software without sudo access is growing.

share|improve this answer
1  
Most packages should have configuration options somewhere so that you can install them in other locations. Using them might require a bit more effort, but if you can't sudo that's what you're stuck with. –  Chris Lutz Nov 2 '11 at 1:30
add comment

It depends if you're installing it for you or for all users. (Mostly. Some things like kernel modules will require root access regardless of who will use the end features.)

Most programs that provide a ./configure script also accept a --prefix=~/bin or --prefix=~/Local/ so that you can install it into your home directory. Not all programs provide a ./configure, but most provide some mechanism in the Makefile that allows you to configure the installation destination.

So: are your libraries / programs for you or for all users on your system?

share|improve this answer
    
They are just for me to use.. and, brill!.. I used ./configure --exec-prefix=/home/username/folder --prefix=/home/username/folder and it seems to have went through ok without sudo (which it didnt when using only ./configure) for libogg, libvorbis, have some trouble with libtheora and vorbis-tools but not sure what thats about yet. I should be able to get it though. Thanks! –  alexbooots Nov 2 '11 at 3:10
2  
You may need to then use a command line option like --theora-path=/home/username/folder when compiling further programs -- be sure to read the README or similar files to learn which variables may need to be changed. –  sarnold Nov 2 '11 at 22:14
add comment

It comes down to read/write/execute file permissions mostly. Sudo doesn't have restricted rights.

Think of an admin account in Windows, versus a user or guest account with restricted rights. Same thing. Hope this helps!

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.