Question

I installed apache2 on my Raspberry Pi, which runs Debian OS.

apt-get intall apache2

Then I removed it using

apt-get remove apache2

But its files were present there, and I could also find some other packages related to apache2 over dpkg. So, I manually deleted the apache2 file from /etc/.

Now when I try to install the apache2 back. It installs it, but do not recalls all the files that were deleted.

I am looking for a fresh installation, for the apache2 with all new fresh files

What should I do.?

Was it helpful?

Solution

How about

apt-get purge apache2

followed by

apt-get autoclean

and then finally

apt-get install apache2

Works on ubuntu on my desktop. Not sure about RasPi though. So, inform me about the results

try to reconfigure the package maybe?

dpkg-reconfigure apache2

good luck

OTHER TIPS

To completly remove all files and dependency packages try

apt-get --purge autoremove apache2

After that you can do a fresh install of apache2

apt-get install apache2

try:

sudo apt-get remove --purge apache2 apache2.2-common apache2-utils

then:

sudo apt-get install apache2 apache2.2-common apache2-utils

Actually when working on Raspian. you cannot do so.

If you uninstall the package using apt-get remove then it is OK.

But that will not remove the files made by the package. So, it will keep the files there. But if in case you delete the files from there then you cannot get it back using apt-get install

There must be a way, but I am not aware of that.

So the best and the easiest way is reinstall the complete OS.

I was in the same position (manually deleted /etc/apache2 and couldn't get it to reinstall those files).

I managed to get it to reinstall a fresh copy of Apache2 without reinstalling the whole OS with two commands:

apt-get --purge autoremove apache2
apt-get install apache2 --reinstall
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top