Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: apt-get remove apache2

  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!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    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!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    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
    Nov 2008
    Beans
    7

    Re: apt-get remove apache2

    Thanks, Jim. Unfortunately, that does not help. /etc/apache2 is still there after stopping Apache and purging or removing the package, with either apt-get or dpkg.

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

  8. #8
    Join Date
    Aug 2008
    Location
    India
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    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

  9. #9
    Join Date
    Aug 2008
    Location
    India
    Beans
    Hidden!
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: apt-get remove apache2

    for other queries regarding apt-get ..
    you can follow this wiki link..
    http://wiki.linuxhelp.net/index.php/Apt-get_Guide

  10. #10
    Join Date
    May 2006
    Location
    Amsterdam
    Beans
    1,731
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: apt-get remove apache2

    aptitude purge apache2 should do the trick.

    But you could also try to run dpkg-reconfigure apache2, this should in theory reconfigure apache (thus creating new config files).
    Upgrade Ubuntu | Upgrade unsupported Ubuntu versions | Always backup | Howto upgrade flash
    Minimal CD install | Remove old kernels | My blog | Linux user #462801 | Conscience doth make cowards of us all. -- Shakespeare

Page 1 of 2 12 LastLast

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
  •