If i install software from source, can i uninstall with apt-get?

Sureshot324

Diamond Member
Feb 4, 2003
3,370
0
71
Say i install a program by downloading a .tar file or whatever and install from that. Can i still run apt-get remove packagename? If not, how would i uninstall the program?
 

kamper

Diamond Member
Mar 18, 2003
5,513
0
0
To uninstall via apt, you'd first have to create a package from the compiled source and then install it. You'd do an uninstall using the package name that you give it.
 

bersl2

Golden Member
Aug 2, 2004
1,617
0
0
No, it doesn't work that way.

If you installed from source, you might be able to use make uninstall, if this is provided for in the Makefile. However, I personally don't trust make uninstall enough to clean everything accurately. It's usually not that hard to find all the files that belong to a program.
 

Sureshot324

Diamond Member
Feb 4, 2003
3,370
0
71
So if i install a program from source with no make uninstall, there is no automatic way to uninstall it?
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Yes there is no automatic way to uninstall it if it installs from source.

However it's not usually hard to to figure out what to undo and delete when it comes to a software install. Check out programs like installwatch which you can use to make logs of file accesses by programs like 'make install' commands. Most everything you install will go into /usr/local directory and thus be easy to find, however every once and a while your going to run into stuff that tries to install into /usr/ for whatever reason.

Otherwise if you want to compile packages you can use deb-src packages to compile from source for whatever optimizations or patches you want to apply (which is relatively easy if you can figure out the documentation) or compile the software and learn how to build your own packages.

Building your own packages isn't as hard as it may seem at first.. since your only going to be doing it yourself you can make lots of assumptions that you wouldn't be able to get away with if your building for other people to use.

 

Sureshot324

Diamond Member
Feb 4, 2003
3,370
0
71
Originally posted by: drag
Yes there is no automatic way to uninstall it if it installs from source.

However it's not usually hard to to figure out what to undo and delete when it comes to a software install. Check out programs like installwatch which you can use to make logs of file accesses by programs like 'make install' commands. Most everything you install will go into /usr/local directory and thus be easy to find, however every once and a while your going to run into stuff that tries to install into /usr/ for whatever reason.

Otherwise if you want to compile packages you can use deb-src packages to compile from source for whatever optimizations or patches you want to apply (which is relatively easy if you can figure out the documentation) or compile the software and learn how to build your own packages.

Building your own packages isn't as hard as it may seem at first.. since your only going to be doing it yourself you can make lots of assumptions that you wouldn't be able to get away with if your building for other people to use.

Doesn't a lot of software but config files in /etc as well? I'll definatly check out install watch. If it can tell me every file and dir that was created during a make install, that's almost as good as having an auto uninstall. It just doesn't feel good to install software without knowing i can't easily remove all traces of it later.
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
Originally posted by: Sureshot324
Originally posted by: drag
Yes there is no automatic way to uninstall it if it installs from source.

However it's not usually hard to to figure out what to undo and delete when it comes to a software install. Check out programs like installwatch which you can use to make logs of file accesses by programs like 'make install' commands. Most everything you install will go into /usr/local directory and thus be easy to find, however every once and a while your going to run into stuff that tries to install into /usr/ for whatever reason.

Otherwise if you want to compile packages you can use deb-src packages to compile from source for whatever optimizations or patches you want to apply (which is relatively easy if you can figure out the documentation) or compile the software and learn how to build your own packages.

Building your own packages isn't as hard as it may seem at first.. since your only going to be doing it yourself you can make lots of assumptions that you wouldn't be able to get away with if your building for other people to use.

Doesn't a lot of software but config files in /etc as well? I'll definatly check out install watch. If it can tell me every file and dir that was created during a make install, that's almost as good as having an auto uninstall. It just doesn't feel good to install software without knowing i can't easily remove all traces of it later.

It depends on the application.

If it's something that wants to have system wide configuration it is suppose to put them in /etc/. Sometimes apps with legacy unix leanings will put it in weird spots like /usr/local/something/etc or maybe even in /var. But thats more unusual. The 'linux' convention is system-wide configurations in /etc/.

However if your just building games or applications that have configurations specific to each user then they usually don't molest /etc/.

The program is actually one word, installwatch. It's just a simple utility that outputs to a file. It's not to usefull for human readable, but it is good output for scripts.

I was actually looking at the installwatch homepage just now and I think it's functionality has been incorporated into checkinstall. It would probably be worth to check that out also..
http://asic-linux.com.mx/~izto/checkinstall/

In debian both are aviable thru apt-get.
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
So if i install a program from source with no make uninstall, there is no automatic way to uninstall it?

No. That would be like extracting a zip file into Program Files on Windows and expecting an uninstaller to appear in Add/Remove program automatically, it's just not possible.

It just doesn't feel good to install software without knowing i can't easily remove all traces of it later.

Which is why I avoid installing things from source as much as possible, there's virtually no reason to do it these days. And if I have no other choice, I use ./configure options to put the whole thing inside of it's own directory (i.e. /usr/local/programname) so that I can just 'rm -rf' the thing later on.
 

Sureshot324

Diamond Member
Feb 4, 2003
3,370
0
71
Originally posted by: Nothinman
It just doesn't feel good to install software without knowing i can't easily remove all traces of it later.

Which is why I avoid installing things from source as much as possible, there's virtually no reason to do it these days. And if I have no other choice, I use ./configure options to put the whole thing inside of it's own directory (i.e. /usr/local/programname) so that I can just 'rm -rf' the thing later on.

What configure options do you use? Does this guarantee that no file will go outside the install directory?
 

drag

Elite Member
Jul 4, 2002
8,708
0
0
depends on the app.

usually to see the the configure options you go something like:
./configure --help

Here is a rough howto for building Slackware packages. In it they talk about modifying the directory options to direct software to install into different directories.
http://www.linuxpackages.net/howto.php?page=package&title=Package+Howto

Also if you install library files into special directory you either have to specify the location of the directory with a enviromental variable (forget which exactly)(like if you want to use a script to launch it) or modify your /etc/ld.so.conf file to include the lib files' directory.