LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   What to keep and what to toss after install and some related questions (https://www.linuxquestions.org/questions/linux-newbie-8/what-to-keep-and-what-to-toss-after-install-and-some-related-questions-641302/)

onda_trollet 05-10-2008 01:08 PM

What to keep and what to toss after install and some related questions
 
Heya!

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...

b0uncer 05-10-2008 01:25 PM

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.

BobNutfield 05-10-2008 01:33 PM

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!

Bob

onda_trollet 05-10-2008 03:07 PM

thanks for quick and very helpful answers!


All times are GMT -5. The time now is 07:24 AM.