0

In my web-server configuration troubleshooting I went through a process of uninstalling apache2 and reinstalling it. I accidentally removed the file /etc/init.d/apache2 which is responsible for starting and stopping the apache service.

I've tried reinstalling the apache2.2-common package which is supposed to place the file, but it is still not present.

How can I do a complete reinstall of Apache? The standard apt-get remove and apt-get install doesn't give me that file back.

alt
  • 113
  • 7
  • possible duplicate of [How to force a re-install from deb repository after local package screw-up?](http://serverfault.com/questions/188622/how-to-force-a-re-install-from-deb-repository-after-local-package-screw-up) – Michael Hampton Feb 11 '13 at 04:14

2 Answers2

1
sudo apt-get -o DPkg::Options::="--force-confmiss" --reinstall install apache2.2-common

This will let you replace config file with out purging package. To remove package use

sudo apt-get purge apache2.2-common

and then install apache the normal way:

sudo apt-get install apache2

I hope this helps

APZ
  • 954
  • 2
  • 12
  • 24
1

You don't need to delete the package first. Just reinstall it:

sudo apt-get install --reinstall apache2.2-common
Michael Hampton
  • 237,123
  • 42
  • 477
  • 940