I'm not sure what to make of this on my Debian server
aptitude install apache2
ls /etc/apache2
You would expect to see configs, right?
aptitude remove apache2
It should remove everything, right?
ls /etc/apache2
But the configs are here.
rm -rf /etc/apache2
aptitude install apache2
ls /etc/apache2
No directory found. Any guidance?
The
purge
operation of apt will remove config files;remove
does not.If you need to restore all files (say, if you deleted them manually), use
dpkg -i --force-confmiss
on the package's .deb within/var/cache/apt/archives/
.First of all, I want to way that
apt-get remove
does not remove the config files. It just removes the indicated package (and any possible dependent package).After installing apache2 package, you can make sure the package is installed using a command like:
So, there are several packages related to apache installed not just "apache2" package. You can check the installed files of a package using a command like:
When I executed the above command, I found that the configuration files are installed by this package not "apache2" package. So, you need to make sure that this package is installed in order to find the configuration files after removing them manually.