Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm aware of the post: How do I remove apache installed with make install and use apache from the repositories?.

I installed httpd2.4 from source. But for httpd2.4, there is no make uninstall available. Are there any easy ways to purge httpd2.4 built and installed from source?

share|improve this question
add comment

1 Answer

I did it this way:

NOTE: please, read carefully, don't break your operating system.

The Idea: get files that appear after "make" (build). Then search those files on system and remove them.

Bibliography:
Uninstall files installed from a source code tar-ball - nixCraft

 - entered to source files of httpd-2.2/ folder.
 # need to clean previous build, and get empty build files snapshot.
 - make clean 
 # get empty build snapshot.
 - find . print | tee make.b4 
 # build project.
 - ./configure && make 
 # get files snapshot after build.
 - find . print | tee make.after 
 # get difference before and after build.
 - diff -y --suppress-common-lines make.b4 make.after | tee httpd_orig 
 # perform needed formatting.
 - cat httpd_orig | column -t | tr -d '>' | tr -d ' ' | sponge httpd_orig 
 # get only files name.
 - cat httpd_orig | xargs -n1 basename | tee httpd_orig_files 
 # get system files snapshot.
 - find /  \( -path /boot -o -path /dev -o -path /home -o -path /lost+find -o -path /media -o -path /mnt -o -path /proc -o -path /root -o -path /run -o -path /tmp -o -path /sys -o -path /var -o -path /opt \) -prune -o -type f -print | tee httpd_on_system 
 # run python script do remove files created on build project we find on system.
 - python unistall.py 

# File: uninstall.py
# Uninstall httpd 2.2 installed from source.
import os

# read file with build project files name.
with open("httpd_orig_files", "r") as f:
    files = f.readlines()

httpd_orig = list()
for line in files:
    # create a list of build files, strip remove newlines.
    httpd_orig.append(line.strip())

# print files name from project build.
print httpd_orig 

# open file with files paths on system.
with open("httpd_on_system", "r") as f:
    httpd_files = f.readlines()

for hfile in httpd_files:
    item = hfile.strip()
    filename = os.path.basename(item).strip()
    status = filename in httpd_orig
    if status:
        print "{:<10} {:50} {}".format(status, filename, item)
        try:    
            # remove files from system.
            os.remove(item)
        except Exception as e:
            print e
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.