Im not responsible if you destroyed your computer or data by following these steps. Deleting things in linux maybe a long and complicated processes if you really wnat to remove all traces of an app existing.

How to uninstall an application completely
###########################################

Imagine that app is munin, which installs itself all over the system

Before removing and app, close it down (ALSO DO A SYSTEM BACKUP IF YOU CAN, OR SNAPSHOT YOU CAN REVER TO! IM NOT RESPONSIBLE IF AFTER THIS YOUR SYSTEM WONT LOAD OR IMPORTANT DATA IS LOST)

Look at the pids, example 543 and 234

Double check its closed by repeating the “ps aux” command

You might need to “kill -9” the processes

So after its closed lets delete

but better:

clean up:

if the last 2 steps removed an app/package you need just “apt-get install” it

Also double check what other software you can get rid of:

Lets say you find this:

munin-common
and
munin-node

So then I can delete those

clean up:

NOTE: check out my article on power deleting apps (be careful with that) HOW TO MASS REMOVE AN APP

Now we are going to work at deleting files and folders that werent removed:

Removing Files and Folders
#############################

now look for files that werent removed

Or if you have multiple filesystems

For the above -xdev/-mount method: You might need to start the search in other locations as / will only look thru the / root filesystem, but what if you had stuff installed in the /home filesystem as well:

NOTE: I show that -xdev and -mount are the same thats why i put it there twice

There is lots of ways to do above commands

What to do with the findings:

Then remove any directories that have munin

Example:
/var/cache/munin/www
so i would remove

Which would remove just the munin folder in /var/cache (but not /var/cache). It would also remove the www folder in munin
However DONT DO THIS:
lets say it found
/etc/munin.conf
Dont delete /etc obviously just delete the munin.conf file

To help with not removing the wrong folders, just look for folders that have word munin in it, and not files:

Look for directories that werent removed as well and remove the directories

Example I see it found

Now not all files are truely cleaned up, some files are shared with other files, so lets clean up the insides of files.

Example: /etc/apach2/apache2.conf
What if you edited somethings there for munin, now you need to remove those edits

Insides of files
###############

Finally lets find all of the config files that mention munin

 

All of the files and folders will be listed.

Go into each file and remove the lines (or sections of lines, or just parts of line) that have munin in it
Becareful you must understand how that setting files worked

Sometimes you will need to remove just part of a line that mentiones munin
Then other times you are safe to delete the whole line that mentions munin
Then there is whole sections that need to be deleted

DELETING MUNIN WORDS IN A LINE
===============================

Some config files munin will be mentioned but you can delete the whole line.
Example: /etc/init.d/.depend.start and /etc/init.d/.depend.sttop

Lets look at /etc/init.d/.depend.start notice munin on the top line

 

NOTE: the above config file is just made up, i grabbed mine and added in munin where I think it will be

Notice we cant just delete the line where munin is, it will delete that whole line

So go in with vi and delete munin from that line

Scroll with arrow keys to the “m” in munin and press “x” until its gone and you only have 1 space between “apache2” and “single” so that it says this after:

 

Then save and exit “:wq!”

Another alternative is to use sed (only use this on config files were your certain deleting the word munin out of each line will be okay):

 

this will also work on:

NOTE: I use a sed search and replace to replace “munin ” (munin and a space sign) with nothingness (the same thing as a delete). Why the extra space? so that I dont get double space between “apache2” and “single” after words

NOTE: I dont think my /etc/init.d/.depend.boot file had anything mentioned about munin, thats why its not mentioned in this example
DELETING MUNIN LINES
=====================

Delete a line example:
/etc/shadow found this line that had munin in it

We can

And scroll down with arrow keys to that line and press “dd” to delete that line then save and exit “:wq!”

Here is a shortcut to delete munin lines (becareful only delete the line if your certain it can go):
I wouldnt use this on config files that have munin “sections” or munin in parts of line. As it only deletes the line. it wont delete the surrounding sections.
So this will be save on files like /etc/shadow and /etc/gshadow and /etc/passwd and /etc/group

that says delete the line that has munin in the shadow file and save it (-i meaning inline, meaning save, with out -i it will jsut show you the result on the output)

DELETING MUNIN SECTIONS
=========================

Deleting sections of munin will not be as easy as above to becuase the sections could be like this

Notice that munin is only mentioned on the top line, but that whole section has to do with it. So we cant jsut delete the line talking about munin, and we cant just talk about the directory

In this case go in with vi and delete all of those 6 lines

Find the top line of the section talking about munin, scroll down to it and press “dd” as many times until that section is gone, then save and exit “:wq!”

Final steps, other config files and dead links
================================================

This method only covers files that talk about munin in clear text. What bout binary files etc. Hopefully the apt-get got rid of all of those.

By now we are almost done some dead links might still exist just double check to get all files:

Then if its just some links you dont care about just do this:

The end
=========

Just reboot the system and hopefully it comes up 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *