Uninstall Apache
Jan 30th, 2008 by scott
So, I’m sure many others have made the same mistake. You downloaded the latest Apache, did the 3 step:
- configure –prefix=/usr/local –enable-mods-shared=all –enable-ssl –enable-proxy
- make
- sudo make install
Doh! That’s probably not what you wanted. Now you have stuff like
- /usr/local/build
- /usr/local/icons
You’d have been better off going with Apache 2’s default prefix which is /usr/local/apache2. The problem is there’s no uninstall! If that’s happened to you and you just made the mistake a short time ago, try this:
- Make sure you have enough free space for a backup of /usr/local
$ sudo du -sh /usr/local
2.2G /usr/local$ df -h
- Back it up
$ tar cvf /tmp/usr_local.tar /usr/local
- Find out which files you just installed
$ sudo find . -type f -newerct ‘60 minutes ago’ > /tmp/uninstall_files.txt
$ sudo find . -type d -newerct ‘60 minutes ago’ > /tmp/uninstall_dirs.txt
- Inspect the file you just created and remove things that don’t belong (e.g. mysql)
- Remove the files (don’t get creative and add -r to rm — you did backup, right?)
$ cat uninstall_files.txt | sudo xargs rm
$ cat uninstall_dirs.txt | sudo xargs rmdir
Now, take off that prefix and try the 3-step again.
Scott Nedderman is the founder of Netphase.com, a consulting practice that specializes in building web applications for Internet startups. He is also a vocalist, plays guitar and penny whistle, occasionally performs in musicals, enjoys camping and is a homeschooling father of 6.



