1

This day I tried to remove apache2. It's bundled with Ubuntu Lucid, which I don't need. I used apt-get remove apache2 to remove it. But somehow, the initscript was still there, in "/etc/init.d/". I tried the apt-get purge command, but the result was the same.

How come the apt-get command fails not remove initscript, even though the script was made by apache2 package.

0

5 Answers 5

0

The exact owner of the init script is apache2.2-common, not the apache2. The apt-get purge apache2 command will purge the apache2 package but only remove apache2.2-common as its dependency. You should name all packages you want to purge to actually purge them or use the reciept from https://serverfault.com/a/326306/52873.

3

The init script is not removed because it is considered to be a configuration file, or "conffile" (because some people might want to tweak their init scripts). In Debian (and derived distributions) conffiles are kept on the system when packages are uninstalled, to make it easier if you want to re-install them later.

If you're sure that you want to remove the conffiles as well, then you should pass the --purge option to apt-get or aptitude.

3
  • Yeah I tried the --purge option as well as apt-get purge apache2. But it still did not work out well. I read the man, it said remove --purge is equivalent to the purge command. So the two commands I used is exactly the same. It's funny to know that this kind of thing do not happen in debian.
    – pepito
    Mar 17, 2012 at 8:47
  • @jollyroger I believe this is the best answer. Many thanks!
    – pepito
    Mar 17, 2012 at 9:50
  • Moved my comment as a separate answer.
    – jollyroger
    Mar 17, 2012 at 23:02
1

A more low-level method to remove the package is:

dpkg --purge apache2.2-common

(I checked the right packages name for you is: apache2.2-common)

1
  • Yeah this one worked! Only I had to remove apache2-mpm-work first. Because there's dependency problem.
    – pepito
    Mar 17, 2012 at 8:59
1

Have you tried apt-get remove apache2 --purge ?

0
1

Use:

dpkg --purge --force-depends apache2.2-common

then:

apt-get install apache2.2-common

The --force-depends makes sure it just removes that package only. It will break your dependencies, but since you're immediately reinstalling it afterwards, it shouldn't be an issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .