Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 05-10-2008, 01:08 PM   #1
Registered: May 2008
Posts: 38

Rep: Reputation: 15
What to keep and what to toss after install and some related questions


I have been installing different programs with the usual configure, make, make install and I got a few questions... :]

1) Can I delete the directory I typed all the install commands in? Or will the program stop workin?
2) How do I uninstall a program in Linux? make clear?
3) I noticed that I sometimes need to do make install as root and sometimes I dont need to be root... How come? The INSTALL file never say anything about me having to change to root. But sometimes I have to or the make install wont work.

I guess thats it for now...

Thankful for help...
Old 05-10-2008, 01:25 PM   #2
LQ Guru
Registered: Aug 2003
Distribution: CentOS, OS X
Posts: 5,131

Rep: Reputation: Disabled
1) Yeah, if the "make install" target (or other way of installation) copied the needed files to your system directories - this is mostly true, but some projects might just build one executable in that directory which you need to move away yourself; I recall ufraw was one of them. So most of the time it's "safe" to remove the source directory. But remember that along it you delete the generated configuration and such.

2) The README and/or INSTALL files should tell you how, if it's possible. There's no rule that says the project needs a way of removing the installed files, so it's up to the software maker to create one or then not. Typically a source project is first compiled (source => binary), then "installed", which actually means just copying the binaries to the right directories on the system, documentation to their own directories etc. etc., depending on what the project consists of. So "removing the installation" means just the opposite: deleting the copied files, and undoing any changes to configurations that were done. Many projects that you can build with make (i.e. they come with a Makefile) do contain an uninstallation target, so running "make uninstall" will remove the "installed" files. Inspect the Makefile for more information and read README and INSTALL files.

3) The compilation process does not need root privileges until you do something that requires root privileges - typically this happens when you need to copy files to directories that users can read but not write to. If the installation steps for example copies a binary to some bin/ directory and you don't have write permissions there, the installation step fails unless you run it as root. If it only copies files to directories where you can write, then it may succeed, but as far as I know, for system-wide (i.e. for all users, not just you) installations the actual "install" step is recommended to be run with root privileges.

About the removing, there are some programs that are specialized in that: instead of executing the "make install" command you execute a program that in turn executes the real installation command and then inspects what files were copied where, makes notes of them, and later when you want to remove the program, you ask this "3rd party" program to remove it, and then it just removes the files it got up. There are many ways how this is achieved: one is that the "manager" program makes the program install itself into a subdirectory inside the build directory, where a directory tree is created that matches the system directories (like source/usr/bin/, source/bin, source/usr/local etc.) - then it saves the file locations to some sort of database and copies that directory recursively to filesystems, thus putting the files into their correct places (this is a simple explanation for such a system, and there are a lot of other ways of doing it - package management is a wide thing, if you start reading about it).

Also note that if you want to use "make uninstall" and remove the source/build directory, you need to unpack it again, reconfigure (./configure -step, remember?) the source in the same way you configured it when installing, and then run "make uninstall" to remove the already installed program. Reconfiguring the source is wise, because if you used some sort of prefix during installation (for example) and later don't set that same prefix, the "uninstall" target probably either fails or even removes wrong files.

The easiest way of installing software nowadays is using a package manager such as apt(-get) or yum if the distribution has one - and if you have the packages available (.deb, .rpm, you name it). Though sometimes it's just easier to install from source - or then it's the only way - and in that case you have to take care of installing, updating and removing of the software completely yourself (or use some software that [semi-]automates this for you) - the software can include some automatic things such as scripts for installing, compiling and/or removing the software, but in the end it's you, the system administrator, that needs to verify how things work and what is the right course of action.
Old 05-10-2008, 01:33 PM   #3
Senior Member
Registered: Dec 2005
Location: United Kingdom
Distribution: Fedora , Ubuntu, Slackware-Current
Posts: 1,477

Rep: Reputation: 51
Hello, welcome to LQ

There is a lot of information about installing from source all over this forum and the web in general. But, I attempt to answer your questions. Someone else may wish to add to my answers.

1. You can USUALLy safely delete the install directory after a source install. That is NOT always the case and the you need to read the README file in the app's install directory

2. When installing from source, you need to again read the README text file for uninstall instructions..Most of the time it is something like:

make uninstall

This may vary so read the file.

3. The requirement to install as root or as a normal user is dependent on the app being installed and the app's developer's code. Installing a program that can be run system-wide usually, but not always, needs root approval. App's that will be solely owned and used by the installing user can usually be installed without root priveledge.

Hope this helps, enjoy your new adventure in Linux!

Old 05-10-2008, 03:07 PM   #4
Registered: May 2008
Posts: 38

Original Poster
Rep: Reputation: 15
thanks for quick and very helpful answers!


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
basic questions on hostname and domain name + related postfix questions Moebius Linux - Newbie 7 09-04-2007 11:50 AM
Apache related questions The_eXXe Linux - Server 1 03-14-2007 12:46 AM
two security related questions krock923 Linux - Security 2 04-28-2006 04:41 PM
NUMA-related questions ssprasad Linux - Newbie 1 07-25-2005 01:23 PM
3 non-related questions Rognon Slackware 5 02-06-2004 04:45 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:13 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration