How to completely remove a package in Debian?
Solution 1
Will remove a package and all configuration files.
apt-get --purge remove package
If it is still giving you issues, try reinstalling then purging:
apt-get --reinstall install package
apt-get --purge remove package
You still might need to:
killall package
Reboot and if it started again run:
update-rc.d remove package
Story Time: Once for some unknown reason, when I purge removed ejabberd; it continued running. I trusted apt-get to kill it and remove it. It didn't. Needless to say, it eventually filled up my entire /var with a ramdisk log file. It continued until I killed all of the ejabberd processes and that quickly resolved the issue. So it taught me to always be sure that apt-get worked and killed all needed processes.
Solution 2
In case you prefer aptitude
:
# aptitude purge denyhosts
purge should also remove the init scripts, so the update-rc.d
step is not really necessary.
Another thing that is possible that another package also provides a daemon called denyhosts. To search for all installed packages that contain files with denyhosts
in them:
$ dpkg -S denyhosts
Related videos on Youtube
datasn.io
Updated on September 17, 2022Comments
-
datasn.io over 1 year
I tried to use this:
aptitude remove denyhosts
And it seemed successfully but after a reboot after I use:
ps aux | grep "denyhosts"
I see denyhosts is still loaded after startup.
So what am I supposed to do so that I can stop and destroy it once and for all? "aptitude remove something" isn't meant for uninstalling?
-
liori over 14 yearsSpelling...
-
Michael Pobega over 14 yearsJust so you know, aptitude is the preferred package manager in Debian.
-
0x89 over 14 yearsThanks, but IF you want to help, point out where somebody misspelled something, don't make them scan the entire post. If you just want to bitch about some non-native speaker making a mistake, have fun.
-
David Rickman over 14 yearsapt-get, aptitude, and dpkg are all preferred package managers for Debian. It doesn't really matter much anymore as it has before. If Debian really only wanted a single package manager, they would symlink one of them to the others and teach the new one the same switches.
-
cas over 14 yearsi would guess that the spelling mistake he's referring to is "dpgk" instead of "dpkg" - it's a typing mistake i make frequently when i'm typing too fast. often enough that i've got used to typing "^gk^kg<ENTER>" to fix it.
-
0x89 over 14 yearsThanks Craig. I thought it was deamon <-> daemon - that's a mistake I frequently make. When I misstype dpkg my zsh kindly asks me if it is allowed to correct my mistake, but Serverfault currently misses that feature ;-)
-
datasn.io over 14 yearsThanks! I found that apt-get couldn't really get rid of the package completely as I installed it with 'aptitude install' in the first place. apatitude purge denyhosts successfully removed the package completely!
-
user649102 over 13 years@kavoir.com "apt-get couldn't really get rid of the package completely" <---- this is just wrong.