LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   "make uninstall" missing (https://www.linuxquestions.org/questions/linux-software-2/make-uninstall-missing-387828/)

syeronne 11-30-2005 03:01 AM

"make uninstall" missing
 
Hi,

How to perform a clean uninstall when target uninstall in Makefile does not exists or do nothing ?

Thanks in advance

rylan76 11-30-2005 03:54 AM

Hmm - no idea but a word of advice - unless you are very tight on disk space not doing a clean uninstall shouldn't be a problem. If, for example, you are upgrading a program, it is usually safe (but not good practice, as you seem to realise) to just delete the main executable, and compile and install the new version of the program.

This works for me with SAMBA, for example, which comes as a very old version with my FC3 distro, and I always "upgrade" it after installing by simply deleting all files I can find which start with "sm" on my filesystem, and then compiling the new version - an uninstall with a makefile is impossible, as the SAMBA I have available post-install is apparently done from an RPM or something. AND - I am loathe to uninstall a RPM installed file (I am loathe to use RPM under -any- circumstances at all) since this often seems to land other people in dependency hell.

syeronne 11-30-2005 04:14 AM

The problem is that usually, "make install" does not install only an executable but some additional files. More than that, if your executable is named "test", additional files may not contain "test" inside their own name. Cleaning all files with "test" will leave some files on your disk.

I don't like the idea of leaving unused files on my disk, even if, as you said, I have enough space on my disk.

My concern is that with "make install" I don't have any idea of what is installed really on my disk. I tried to look in Makefile in the install target, or even tried "make -n install" but I'm not using Linux for enough time to be cumfortable with that. I'd like to have some option, like "rpm -ql" to see what and where is going to be installed.

T.Hsu 11-30-2005 04:36 AM

Provided the makefile support DESTDIR variable, you may use

make install DESTDIR=/path/to/a/fakeroot

to install the program to a fakeroot first, log everything it installed, then begin the actual installation, or just use io redirect or tee command to log the "make install" output, and examine the log carefully.

Another quick and dirty way is using checkinstall to make a package.

syeronne 11-30-2005 08:05 AM

Just to be sure I understand the way make is working.

As an example, make may produce an executable, let's call it "test" installed in /usr/local/bin/ and some manual pages, let's call it "man.test" installed in /usr/local/man/, by default. That means that "/" is the root directory.

If I use variable DESTDIR i'm going to change the roo directory ?

In my example, "make install DESTDIR=/home/myname/" would copy "test" in /home/myname/usr/local/bin and "man.test" in /home/myname/usr/local/man/" ???


To get further, I could run several make command using different DESTDIR resulting in multiple "test" installs ?

T.Hsu 11-30-2005 08:43 PM

Yes, you are right.

rylan76 12-01-2005 01:27 AM

Quote:

Originally posted by syeronne
Just to be sure I understand the way make is working.

As an example, make may produce an executable, let's call it "test" installed in /usr/local/bin/ and some manual pages, let's call it "man.test" installed in /usr/local/man/, by default. That means that "/" is the root directory.

If I use variable DESTDIR i'm going to change the roo directory ?

In my example, "make install DESTDIR=/home/myname/" would copy "test" in /home/myname/usr/local/bin and "man.test" in /home/myname/usr/local/man/" ???


To get further, I could run several make command using different DESTDIR resulting in multiple "test" installs ?

Yes that's pretty much it. This is a usefull way to test new, or doubtful software or libraries. For example, I have two GTK versions on my system - the one that came with FC3 and the a newish 2.6 version. I installed the "second" GTK by doing

./configure --prefix=/opt/gtk2.6

on all the source library files for GTK 2.6 which installed GTK 2.6 in the /opt directory. By setting up certain environment variables I am thus able to selective compile a program against either the "new" GTK or the "old" GTK on my system. Everything about the "new" GTK is in the opt subidrectory - libraries, scripts, man pages, the works.


All times are GMT -5. The time now is 08:30 PM.