Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Un - install stuff that has not been installed with a package manager

Status
Not open for further replies.

jez

Programmer
Apr 24, 2001
370
VN
OK, so i can do apt-get remove or the RPM equiv, but how do i remove (for example) apache? If it has been installed from source?

I need to install apache and mod ssl, but the tutorial says that first i have to get rid of the apache that is there already... it was put there by hand but how do you uninstall stuff in linux (to be honest i have been wondering this for ages).



Thanks

Jez
 
If it was installed from source,
Do a `make uninstall` from the source directory.
If you don't have it, compile it again (with the same options if any were used)

"If you always do what you've always done, you will always be where you've always been."
 
jez said:
how do you uninstall stuff in linux (to be honest i have been wondering this for ages).
This operation unfortunately usually requires foresight at install time.

If someone left the Apache source directory or documented the configuration used to build it, the above suggestion will work provided that the Apache Makefile actually has an [tt]uninstall[/tt] target; many don't.

If Apache happened to be installed entirely under [tt]/opt/apache[/tt] or a similar Apache-specific directory, you can just remove that directory recursively.

Other examples of foresight at install time include using something like Installwatch or Install-Log to keep a list of files installed, using something like Stow or Encap to manage software in package-specifc directories, or using something like Checkinstall to make distribution-specific packages out of source code so they can be properly managed.

Also, slightly on-topic, you might find ZeroInstall interesting.
 
Ok, great thanks..... but foresight does not really help here, does it. More importantly MY foresight in an istallation may help the poor soul who comes to deal with the system later, but in the real world I seldom work on the same system for more than one project, so i have to rely on someone else's foresight.

I love Linux, but I am very aware of the things that hold it back.
In a windoze system, to remove something you need to get rid of the actual files, clear any shortcuts and delete any references in the registry. This may be harder than it sounds but it is a fixed list of things to do.
Until i know what (and where) makes an app work on linux then i can never really claim to know the system.

I guess what i am wondering is... given that i can probably find the istall directory (and then delete it) what else is it that makes linux aware of an app.

Also unless i can be competely sure of what is / is not running or installed I cannot secure a system.
 
but foresight does not really help here, does it.
That depends on whether or not your predecessor had any. I'm just trying to tell you some of the things he or she may have done to make the uninstallation possible.


given that i can probably find the istall directory (and then delete it)

There's usually no "install directory," as was mentioned above.

Executable commands are usually installed under [tt]$prefix/bin[/tt], libraries are usually installed under [tt]$prefix/lib[/tt], documentation is normally installed under [tt]$prefix/share/man[/tt], [tt]$prefix/share/info[/tt], and [tt]$prefix/share/doc[/tt], and application data is usually installed under [tt]$prefix/share/$application[/tt].

Additionally, some packages install files into subtrees that are "owned" by other packages. For example, it might place an Autoconf macro in [tt]$prefix/share/aclocal[/tt], or it might install files into [tt]/etc/rc.d[/tt] to make a server start up when the system is booted.


what else is it that makes linux aware of an app.
Linux (specifically, the shell and the C library) is made aware of commands by placing the executables in a directory in the [tt]PATH[/tt] environment variable.

The linker is made aware of static libraries by placing the libraries in locations specified in the linker's linker scripts. It can also be made aware of them at runtime using the [tt]-L[/tt] and [tt]-l[/tt] switches.

The dynamic linker is made aware of shared libraries by placing them in locations specified in the dynamic linker's config file ([tt]/ld.so.conf[/tt]) and by running [tt]ldconfig[/tt] to update the linker's cache file.

Internet-related servers are usually started by a program called Inetd, which probably has a config file in which the servers are listed. Check the docs for how Inetd is made aware of services.

Man page viewers and info viewers are made aware of documentation by putting the files in paths specified in ways specific to those applications.


Those should cover most of the ways that Linux "knows" about Apache. There's no equivalent to a Windows registry on Linux (at least not one that's standardly used).

Removing all those things still doesn't ensure that all Apache files are removed, though. Just all the things that are immediately accessible by other programs. For example, I imagine that Apache has a separate directory for "mods"; that's probably in [tt]var/lib[/tt] or something like that; they can't run without Apache, so you probably want to remove them anyway, even though nothing else can "see" them.


If your predecessor didn't save their Makefile and you couldn't regenerate the Makefile from source, or if the Makefile didn't even have an [tt]uninstall[/tt] target, you might try installing Apache from source, but installing it into its own directory tree. Then, you'll have a list of files that got installed, and you can just remove the installed equivalents of those files from your system.
 
Excellent, thankyou.

That was exactly what i was looking for. I know linux doesnt have a registry as such which is why i have generally been wondering where all the information goes that makes things work.


Thanks again,

Jez
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top