Results 1 to 10 of 12

Thread: apt-get remove apache2

Hybrid View

  1. #1
    Join Date
    Nov 2008
    Beans
    7

    apt-get remove apache2

    Hi,

    I've tried to remove the apache2 package from my system with "apt-get remove apache2". But it let the /etc/apache2 directory, so I removed it with "rm -r /etc/apache2". When I "apt-get install apache2" again, it does not reinstall the config files. I tried apt-get purge too.

    How can I remove completely the package (including what is in /etc) and then reinstall it again (including the original files in /etc) ?

    Regards,

    --
    Florent Georges
    http://www.fgeorges.org

  2. #2
    Join Date
    Aug 2008
    Location
    India
    Beans
    Hidden!

    Re: apt-get remove apache2

    why don't you try this one with synaptic.. there you have an option of "complete removal" and when you will apply the changes it will ask for removal for config files..
    .. I think this will do the job..

  3. #3
    Join Date
    Nov 2008
    Beans
    7

    Re: apt-get remove apache2

    Thanks for the response. AFAIK, synaptic is a graphical interface, and I am running Ubuntu on a server (besides, I am calling apt-get from a script.)

    Regards,

    --
    Florent Georges
    http://www.fgeorges.org/

  4. #4
    Join Date
    Aug 2008
    Location
    India
    Beans
    Hidden!

    Re: apt-get remove apache2

    Okk.. well then you should try this command..
    Code:
    sudo apt-get --purge remove <package name>
    but this works only when you have that package installed..
    suppose you have uninstalled that package and then run this command.. you will get an error..
    so,, in order to remove the old configuration files with the package already removed you should probably try this command..
    Code:
    sudo dpkg --purge <package name>
    and as i have already mentioned..this works even when the package is not really installed..
    Last edited by shredder12; January 30th, 2009 at 07:54 PM.

  5. #5
    Join Date
    Nov 2008
    Beans
    7

    Re: apt-get remove apache2

    Mmh, actually dpkg --purge doesn't work on my system:

    dpkg - warning: ignoring request to remove apache2 which isn't installed.

    If I use either command when the package is installed, /etc/apache2 is not removed... And if I remove it by hand, it is not reinstalled by a subsequent install.

    I am testing admin scripts; it would be very, very convenient to be able to entirely suppress the apache2 package, and still be able to reinstall a completely clean version.

    Maybe did I do something wrong? Thanks for your help,

    --
    Florent Georges
    http://www.fgeorges.org/

  6. #6
    Join Date
    Mar 2006
    Location
    Williams Lake
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: apt-get remove apache2

    Did you stop apache2 before you tried to remove it? Stop the service and then run:

    Code:
    sudo apt-get purge apache2
    I ran into the same problem a while back. I use mc as a file manager, ftp client, and more. MC allows you to open a .deb and copy a config file or whatever you need, to any location. I do this when I've forgotten to make a backup of a configuration file before changing it.

    MC is available in the repositories.

    Jim

  7. #7
    Join Date
    Aug 2008
    Location
    India
    Beans
    Hidden!

    Re: apt-get remove apache2

    hey, chk this out..
    i think its the same problem you are facing..
    http://ubuntuforums.org/showthread.php?t=296875

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •