5

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?

wzzrd
  • 10,269
  • 2
  • 32
  • 47
datasn.io
  • 279
  • 1
  • 4
  • 15

2 Answers2

14

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.

David Rickman
  • 3,290
  • 17
  • 16
  • Just so you know, aptitude is the preferred package manager in Debian. – Michael Pobega Sep 05 '09 at 18:19
  • 3
    apt-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. – David Rickman Sep 06 '09 at 00:39
4

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
0x89
  • 6,345
  • 3
  • 21
  • 14
  • Spelling... – liori Sep 05 '09 at 17:36
  • 1
    Thanks, 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. – 0x89 Sep 05 '09 at 21:17
  • 1
    i 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" to fix it. – cas Sep 06 '09 at 01:22
  • Thanks 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 ;-) – 0x89 Sep 06 '09 at 09:55
  • Thanks! 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! – datasn.io Sep 06 '09 at 14:12
  • @kavoir.com "apt-get couldn't really get rid of the package completely" <---- this is just wrong. – cstamas Oct 17 '10 at 18:13